General Knowledge :: Testing New
-
Find the output of the following program.
void main()
{
printf("%d, %d", sizeof(int *), sizeof(int **));
}
-
Find the output of the following program.
void main()
{
int i=10; /* assume address of i is 0x1234ABCD */
int *ip=&i;
int **ipp=&&i;
printf("%x,%x,%x", &i, ip, *ipp);
}
-
Which of the following statements are true after execution of the program.
void main()
{
int a[10], i, *p;
a[0] = 1;
a[1] = 2;
p = a;
(*p)++;
}
- What is the base data type of a pointer variable by which the memory would be allocated to it?
-
What would be the output for the following Turbo C code?
#include<stdio.h>
void main()
{
int a[]={ 1, 2, 3, 4, 5 }, *p;
p=a;
++*p;
printf("%d ", *p);
p += 2;
printf("%d", *p);
}
-
char* myfunc(char *ptr)
{
ptr+=3;
return(ptr);
}
void main()
{
char *x, *y;
x = "EXAMVEDA";
y = myfunc(x);
printf("y=%s", y);
}
What will be printed when the sample code above is executed?
-
char *ptr;
char myString[] = "abcdefg";
ptr = myString;
ptr += 5;
what string does ptr point to in the sample code above?