main()
{
char string[]="Hello World";
display(string);
}
void display(char *string)
{
printf("%s",string);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Compiler Error : Type mismatch in redeclaration of
function display
Explanation :
In third line, when the function display is
encountered, the compiler doesn't know anything about the
function display. It assumes the arguments and return types
to be integers, (which is the default type). When it sees
the actual function display, the arguments and type
contradicts with what it has assumed previously. Hence a
compile time error occurs.
| Is This Answer Correct ? | 21 Yes | 3 No |
Answer / pratibha
this problem of type mismatching can be solved by declaring display function as a first line inside main() so that compiler will know that display is of type void and then it will resolve type mismatch while encountering calling function of display.
| Is This Answer Correct ? | 0 Yes | 0 No |
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }
How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.
main() { main(); }
Under linux environment can u please provide a c code for computing sum of series 1-2+3-4+5......n terms and -1+2-3+4-5...n terms..
main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }
How do you create a really large matrix (i.e. 3500x3500) in C without having the program crash? I can only reach up to 2500. It must have something to do with lack of memory. Please help!
plz send me all data structure related programs
How to return multiple values from a function?
void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
main() { char a[4]="HELL"; printf("%s",a); }
main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }