519 Posted Topics

Member Avatar for kymarscheng

Why dont you create a simple text file. Put what ever data you want to put in that file. After that you can use something like the chmod command

Member Avatar for kymarscheng
0
166
Member Avatar for Whilliam

[QUOTE=Whilliam;1120719] [code] void main() { trie t; int ctr; for(ctr = 0; ctr < max; ctr++) t.(*letter)[ctr] = NULL; } [/code] [/QUOTE] You have to write [code] for(ctr = 0; ctr < 10; ctr++) t.letter[ctr]=NULL; [/code]

Member Avatar for abhimanipal
0
75
Member Avatar for priyarrb

I would advise you to use structures instead of so many arrays. Swapping structures is as easy as a=b This will reduce the chances of error in your code

Member Avatar for abhimanipal
-1
144
Member Avatar for miles.85

Check out this link. I think this will be useful [url]http://www.linuxquestions.org/questions/programming-9/c-howto-read-binary-file-into-buffer-172985/[/url]

Member Avatar for miles.85
0
143
Member Avatar for mfrancis107

[QUOTE=WaltP;1120555] Or, knowing the limitation of [iCODE]int[/iCODE] [/QUOTE] What is this limitation ?

Member Avatar for WaltP
0
157
Member Avatar for abhimanipal

Hello Everybody, I have just come across this particular piece of code in a C problem set [code= c] main() { int i=5,j=6,z; printf("%d",i+++j); } [/code] The answer for this question is 11 because C evaluates this as i++ +j. But why cant this be evaluated as i+ ++j. Is …

Member Avatar for SpyrosMet
0
265
Member Avatar for thirupathireddy

[code=c] struct host_msgs_list *root, *temp, *temp1; root = NULL; temp=root; [/code] Are all these local variable or are these global variables ?

Member Avatar for abhimanipal
0
113
Member Avatar for james chaco

In general you have do some thing of this sort [code=c] while(1) { //Accept a new command from the user // Fork a new process // The child process handles the new command, finishes it and returns the status to the parent } [/code]

Member Avatar for abhimanipal
0
109
Member Avatar for jennystc

Are you allowed to use relational operators ? If yes you could do something of this sort [code=c] total_marks= 85 //For example if the total marks are 85 printGrades(total_marks); void printGrades(total_marks) { i=total_marks; for(;i>=90;) { printf("A\n"); exit(1); } for(;i>=80;) { printf("B\n"); exit(1); } } [/code]

Member Avatar for abhimanipal
0
190
Member Avatar for zapman2003

Quick question can you do something of this sort ? Will help you to simplify the code ? [code=c] void calc() { // Check which operation is to be done // Then call the appropriate function } [/code] Check this link for more information on function pointers [url]http://www.cprogramming.com/tutorial/function-pointers.html[/url]

Member Avatar for zapman2003
0
191
Member Avatar for xtian002
Member Avatar for abhimanipal

Is there any standard rules when we write the main function. I always thought the main function should always be written as [code=c] int main(int argc, char* argv) { ..... return 1; } [/code] But to my surprise, all these definitions are also correct . I got a compile time …

Member Avatar for Narue
0
243
Member Avatar for cktbrd

Or you can use pointers. Some thing of this sort [code=c] int main(int argc, char* argv[]) { char *p; p="hellow World"; printf("%s\n",p); return 1; } [/code]

Member Avatar for cktbrd
0
95
Member Avatar for Gaiety

[QUOTE=Gaiety;1115279]Yet Another Version of Findind a Prime number: [CODE] #define CHK_NUM_IS_2_3_5( n ) ( n == 2 || n == 3 || n == 5 ) #define REM_2( n ) ( n % 2 != 0 ) #define REM_3( n ) ( n % 3 != 0 ) #define REM_5( …

Member Avatar for Gaiety
0
2K
Member Avatar for abhimanipal

Hello All, I am unable to understand this piece of code [code= c] main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } [/code] I got this question from a C problem set. I run this code and I have to give the i/p 3 …

Member Avatar for xavier666
0
142
Member Avatar for abhimanipal

Hello, I have a conceptual code related to the C memory allocation model if I have some code of this form, I will get a seg fault [code=c] int main() { char* p; *(p+5)='A'; printf("%c\n",*(p+5)); } [/code] But when I have some code of this form I do not get …

Member Avatar for WaltP
0
281
Member Avatar for Kombat

You can check out this link. I think this contains sufficient information to get you started at least [url]http://en.wikipedia.org/wiki/Multiplexer[/url]

Member Avatar for abhimanipal
0
268
Member Avatar for abhimanipal

Hello, [code= c] main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); } [/code] The answer to this question is 4 1 and the reasoning is that the compiler finds j to be true and hence does not need to check the remaining …

Member Avatar for Ancient Dragon
0
105
Member Avatar for abhimanipal

[code=c] union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("n%d", sizeof(u)); printf(" %d", sizeof(u.a)); printf("%d", sizeof(u.a[4].i)); } [/code] Hello People. I just came across this piece of C code. I have a couple of question The third printf statement gives me the …

Member Avatar for kvprajapati
1
110

The End.