Is there any difference between the two declarations,
1. int foo(int *arr[]) and
2. int foo(int *arr[2])
Answer / susie
Answer :
No
Explanation:
Functions can only pass pointers and not arrays. The numbers
that are allowed inside the [] is just for more readability.
So there is no difference between the two declarations.
| Is This Answer Correct ? | 1 Yes | 6 No |
#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); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }
how to test pierrot divisor
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
how to return a multiple value from a function?
main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; } a. Runtime error. b. Compile error. Illegal syntax c. Gets into Infinite loop d. None of the above
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above
main() { int i=5; printf(“%d”,i=++i ==6); }
main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000
#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }
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..