No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
5 Posted Topics
I thought that the function parameters were pushed onto stack from right to left. [code=C] #include <stdio.h> main() { int i=0; printf("%d %d\n",scanf(" %d",&i),i); } [/code] But this code prints out the keyboard entered value instead of 0. Why is it so? | |
I have the following code, [code=C] main() { char *p="abc"; int x; x=++*p++; printf("%d",x); } [/code] My question is, when I try to do x=++*p++, the program crashes. If my associativity rules are right, first the address pointed to by p should be incremented by the postfix (p++) and then … | |
[code=C] #include<stdio.h> int array[]={1,2,3,4,5,6,7,8}; #define SIZE (sizeof(array)/sizeof(int)) int main() { printf("%d",SIZE); if(-1<=SIZE) printf("1"); else printf("2"); return 0; } [/code] how is SIZE casted in this example? Because the compiler believes -1 > SIZE (which is 8). Is this because it was treated as unsigned char and -1 looped around to … | |
Re: Its a linker error caused due to a shared library | |
Hi, this is the code that I have to swap two strings- [code=C] void swap(char *,char *); main() { char *x="new"; char *y="word"; char *t; swap(x,y); printf("(%s,%s)",x,y); } void swap(char *x,char *y) { char *t; t=x; x=y; y=x; } [/code] output- (new,word) Why is the swap function not swapping the … |
The End.