Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
0 Endorsements
~8K People Reached
Favorite Tags
Member Avatar for tubby123

Hey guys, Is android an OS or firmware ? I understand that the firmware is programmed onto the hardware, and runs the OS. BIOS is Firmware, and Windows is OS. So, what's the firmware for Android OS ? What runs the Android code ?

Member Avatar for caperjack
0
50
Member Avatar for tubby123

Hey, Is there any difference between the 2 syntax, ie, str = "This is a test"; and strcpy(str,"This is a test"); I think, both of them, malloc some random 200 addresses, and give the starting location of the 200 chunk to the pointer variable 'ptr'. #include<stdio.h> char* str; int main(void) …

Member Avatar for Perry31
0
101
Member Avatar for tubby123

Hey, Is there a way to know the contents at address 6295600(say) in C ? I don't want to do using a pointer, that is, something like printf("%d",*p); int a = 5; p = &a; and address of a = 6295600. I want to be able to do something like, …

Member Avatar for Ancient Dragon
0
55
Member Avatar for tubby123

How do I print out the address a pointer is holding. Currently I'm using the code pasted below. But I'm getting this error. Error: t.c:13:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘char *’ [-Wformat] Code: #include<stdio.h> #include<malloc.h> #include<string.h> #include<stdlib.h> char* str; int …

Member Avatar for Ancient Dragon
0
86
Member Avatar for tubby123

Please refer the code below I am trying to read integers from a file (till the end of file). But my problem is that only the last number is printed twice. /* fscanf example */ #include <stdio.h> int main () { int i; FILE * fp; fp = fopen ("/home/my/Desktop/write.txt","r"); …

Member Avatar for Ancient Dragon
0
98
Member Avatar for tubby123

A lot of people tell me that my code results in Memory Leaks. Since, I am still in an academic environment, it has not had any drastic result on any projects, but I still want to correct it. I have posted below some C code, please go through the coding …

Member Avatar for michelleradu
0
158
Member Avatar for tubby123

Reading a character from the keyboard keeps giving me problem. When I do a gcc -o progname progname.c and ./progname, and press enter, it doesn't stop to receive the character. How can I correct this ? Code blocks are created by indenting at least 4 spaces ... and can span …

Member Avatar for zeroliken
0
140
Member Avatar for shean1488

Help me please to find the problem in my code: Here is the error that I'm getting: serg@serg-PORTEGE-Z835:~/c$ gcc string_finder.c -o string_finder string_finder.c:4:5: error: conflicting types for ‘getline’ /usr/include/stdio.h:671:20: note: previous declaration of ‘getline’ was here string_finder.c:22:5: error: conflicting types for ‘getline’ /usr/include/stdio.h:671:20: note: previous declaration of ‘getline’ was here …

Member Avatar for tubby123
0
268
Member Avatar for tubby123

Why is it that this won't work instead of using atoi ? `Inline Code Example Here` #include<stdio.h> int main(void) { printf("%d",(int)"10"); return 0; }

Member Avatar for Ancient Dragon
0
72
Member Avatar for tubby123

Hey, how do you declare an array of strings using double pointer ? I normally use [CODE]char* str[] = {"this", "works", "fine" ,"for", "me"}; [/CODE] But I want to know if there is a way of declaring array of strings using something like [CODE]char** str; [/CODE] Please show me how …

Member Avatar for luisvaldes88
0
231
Member Avatar for tubby123

Hi, I get the error "warning: array ‘str’ assumed to have one element [enabled by default]" when I am trying to fill in values inside the string array. [CODE]#include<stdio.h> #include<string.h> #include<malloc.h> char* str[]; int i = 0; int main(void) { for(i=0;i<5;i++) str[i] = (char*)malloc(200 * sizeof(char)); strcpy(str[0],"hello"); strcpy(str[1],"my"); strcpy(str[2],"name"); strcpy(str[3],"is"); …

Member Avatar for Adak
0
1K
Member Avatar for tubby123

Hi, I don't understand why we typecast malloc. For example, while creating a string/character array, we normally do, [CODE]line = (char*)malloc(200 * sizeof(char));[/CODE] assume we have already declared char* line; I was just reading the malloc man pages and it says that malloc allocates that much memory and returns a …

Member Avatar for tubby123
0
160
Member Avatar for tubby123

Hey , I wanted to know if browsing a page takes the same data as downloading it. Also, does streaming a youtube video take the same bandwidth as downloading it. The obvious answer would be yes, because buffering is basically downloading in itself. But I have noticed that it takes …

Member Avatar for Cameronsmith63
0
108
Member Avatar for tubby123

Hey, I have a problem taking input from the terminal. I need to read an integer first, then a string. But when I press enter after entering the integer, the string doesn't take any input. Yes, I did try using a fflush(stdin) between the 2 inputs, still doesn't work. I …

Member Avatar for tubby123
0
143
Member Avatar for tubby123

Hello people, I want to write a program which does the equivalent of going to google and searching for a word. So, for example, instead of going to google and typing out 'daniweb', I want to do that from a program. Does google offer any api's for that ?

Member Avatar for tubby123
0
81
Member Avatar for tubby123

Hey, I am doing my Final Year Project on NLP - something along IBM's Deep QA Project. [URL="http://en.wikipedia.org/wiki/Watson_(computer)"]http://en.wikipedia.org/wiki/Watson_(computer)[/URL] I would like to know what will be a good IDE to work on. My parameters for a good IDE in this project would be : 1)Good API's for Speech to Text …

0
52
Member Avatar for tubby123

Hey, is there a way to replace a single characters by 2 characters in a string ???? This was asked to me at 1 of the interviews. I answered linked list, I mean, take each node as a character, so u can easily insert 2 nodes, if u want to …

Member Avatar for Narue
0
106
Member Avatar for tubby123

What is the number of swaps required to sort n elements using selection sort, in the worst case? The site i am referring says theta(n). Shouldnt it be theta(n2), cuz worst case it requires n swaps for each of the n elements.

Member Avatar for Narue
0
84
Member Avatar for tubby123

Guys, ok after trying around stuff, I get that this is the way you initialize a structure in C. [CODE]#include<stdio.h> #include<conio.h> typedef struct s { int data; char gender; }st; st s1={5,'a'}; int main(void) { printf("%d "%c",s1.data,s1.gender); getch(); return 0; } [/CODE] But suppose i make a new instance of …

Member Avatar for Narue
0
86
Member Avatar for tubby123

I have this really weird doubt in extern usage Consider the code [CODE] #include<stdio.h> int main(void) { extern int a; printf("%d",a); getch(); return 0; } int a=20;[/CODE] How is it that this code gives the output as 20 ??? My guess Since its an extern variable, it can be declared …

Member Avatar for Narue
0
88
Member Avatar for tubby123

Guys , for this question, i have been able to come up with the O(n logn) - by sorting, and O(n.k) - by Tournament Principle algorithms, I read in a few places about Ordered Statistics but couldnt get anything out of it. Please can some1 give me an O(n) algo …

Member Avatar for JeffGrigg
0
142
Member Avatar for tubby123

Guys, this is the code from KnR I dont understand this line nunits = (nbytes+sizeof(Header)-1)/sizeof(header) + 1; The entire code is as follows [CODE]static Header base; /* empty list to get started */ static Header *freep = NULL; /* start of free list */ /* malloc: general-purpose storage allocator */ …

Member Avatar for rubberman
0
129
Member Avatar for tubby123

I have 2 doubts 1)what is the default value of a mutex ? Is it 0 or 1? 2)Why cant we have a code like, this to solve the Concurrency issues. I mean, i know its not possible, but this was asked to me at an interview ... [CODE]if(pid == …

Member Avatar for TrustyTony
0
130
Member Avatar for tubby123

[CODE]union { int a; char b; char c[10]; }u1; void main() { int l=sizeof(u1); printf("%d",l); getch(); } [/CODE] This gives the output as 10, shouldnt it be 2 + 1 + 10 == 13 ??? Can some1 explain ?

Member Avatar for Adak
0
81
Member Avatar for tubby123

hey, is there an optimized way to generate primes between 2 limits ? I was recently asked this question in an interview. Obviously, the Brute Force method would be to run a loop between the limits and check if each number has a factot between 2 and square-root of the …

Member Avatar for tubby123
0
84
Member Avatar for tubby123

guys, i am having trouble printing the LCS. This is the algorithm i am following to get the count of the LCS. [CODE]int main(void) { printf("\nThe LCS is %d",LCS(0,0)); } int LCS(int m, int n) { if(m==l1 || n==l2) return 0; if(X[m] == Y[n]) return 1 + LCS(X[m+1],Y[n+1]); else return …

Member Avatar for Momerath
0
168
Member Avatar for tubby123

In programming terms, Is there any difference between Generate Anagrams, and Generate Permutations of a string ????

Member Avatar for Adak
0
146
Member Avatar for tubby123

Hey is there a way to find the maximum occuring character in a string without using a hash map. ? Maybe in dynamic Programming or something ???

Member Avatar for mrnutty
0
102
Member Avatar for tubby123

1) Let X be the length of the first linked list until intersection point. Let Y be the length of the second linked list until the intersection point. Let Z be the length of the linked list from intersection point to End of the linked list including the intersection node. …

Member Avatar for tubby123
0
162
Member Avatar for tubby123

I am finding the recursion very difficult on this one. Could someone explain this to me. If this is a famous algorithm, a link containing the explanation would also do. I thought probably a couple of magic lines from you would change the way i am looking at this. I …

Member Avatar for nezachem
0
73