General Knowledge :: Testing New
- The operator > and < are meaningful when used with pointers, if
-
The declaration
int (*p) [5];
means -
Comment on the following?
const int *ptr; -
#include<stdio.h>
void main()
{
int *ptr, a=10;
ptr = &a;
*ptr += 1;
printf("%d, %d", *ptr, a);
}
- A function 'p' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as
-
What will be printed after compiling and running the following code?
main()
{
char *p;
printf("%d %d",sizeof(*p), sizeof(p));
}
-
What will be the output of the following program code?
#include <stdio.h>
void main()
{
int i=3, *j, **k;
j = &i;
k = &j;
printf("%d%d%d", *j, **k, *(*k));
}
- Which of the following is the correct way of declaring a float pointer:
-
Find the output of the following program.
void main()
{
char *msg = "hi";
printf(msg);
}
-
Find the output of the following program.
void main()
{
int array[10];
int *i = &array[2], *j = &array[5];
int diff = j-i;
printf("%d", diff);
}