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 |
how can i cast a char type array to an int type array
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
To reverse an entire text file into another text file.... get d file names in cmd line
main() { int i=5,j=6,z; printf("%d",i+++j); }
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }
main() { extern out; printf("%d", out); } int out=100;
Program to find the largest sum of contiguous integers in the array. O(n)
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
write a c program to Reverse a given string using string function and also without string function
All the combinations of prime numbers whose sum gives 32