What would be the equivalent pointer expression for referring the array element a[i][j][k][l]
What is (void*)0?
What will be the output of the program?
#include<stdio.h>
int main()
{
int arr[2][2][= {8};
int *p, *q;
p = &arr[1][1][1];
q = (int*) arr;
printf("%d, %d\n", *p, *q);
return
}
What will be the output of the program ?
#include<stdio.h>
#include<string.h>
int main()
{
int i, n;
char *x="Alice";
n = strlen(x);
*x = x[n];
for(i=i<=n; i++)
{
printf("%s ", x);
x++;
}
printf("\n", x);
return}
A pointer is
Can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);
What will be the output of the program assuming that the array begins at the locationand size of an integer is 4 bytes?
#include<stdio.h>
int main()
{
int a[3][= {};
printf("%u, %u, %u\n", a[0]+*(a[0]+1), *(*(a+0)+1));
return
}
What will be the output of the program ?
#include<stdio.h>
int main()
{
int i, a[] = {10};
change(a, 5);
for(i=i<=i++)
printf("%d, ", a[i]);
return}
void change(int *b, int n)
{
int i;
for(i=i<n; i++)
*(b+= *(b+i)+}
What will be the output of the program ?
#include<stdio.h>
void fun(void *p);
int i;
int main()
{
void *vptr;
vptr = &i;
fun(vptr);
return
}
void fun(void *p)
{
int **q;
q = (int**)&p;
printf("%d\n", **q);
}
The operator used to get value at address stored in a pointer variable is
In which header file is the NULL macro defined?
What will be the output of the program?
#include<stdio.h>
int main()
{
int arr[= {4};
char *p;
p = arr;
p = (char*)((int*)(p));
printf("%d, ", *p);
p = (int*)(p+1);
printf("%d", *p);
return
}
If the size of integer is 4bytes, What will be the output of the program?
#include<stdio.h>
int main()
{
int arr[] = {16};
printf("%d, %d, %d\n", sizeof(arr), sizeof(*arr), sizeof(arr[0]));
return}
What will be the output of the program ?
#include<stdio.h>
int main()
{
char *str;
str = "%s";
printf(str, "K\n");
return}
How many bytes are occupied by near, far and huge pointers (DOS)?
What will be the output of the program ?
#include<stdio.h>
int main()
{
char *str;
str = "%d\n";
str++;
str++;
printf(str-300);
return}
What will be the output of the program ?
#include<stdio.h>
int *check(static int, static int);
int main()
{
int *c;
c = check(20);
printf("%d\n", c);
return}
int *check(static int i, static int j)
{
int *p, *q;
p = &i;
q = &j;
if(i >= return (p);
else
return (q);
}
What will be the output of the program ?
#include<stdio.h>
int main()
{
char str[] = "peace";
char *s = str;
printf("%s\n", s++ +3);
return}
What will be the output of the program ?
#include<stdio.h>
int main()
{
static char *s[] = {"black", "white", "pink", "violet"};
char **ptr[] = {s+s+s+s}, ***p;
p = ptr;
++p;
printf("%s", **p+1);
return}
Point out the compile time error in the program given below.
#include<stdio.h>
int main()
{
int *x;
*x= return}