What will be the output of the following program code?
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%f", *(float *)p);
}
What will be the output of the following program code?
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%f", *(float *)p);
}
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
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 the output of the following program?
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
}
What will be the output of the following program?
#include<stdio.h>
void main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
}
The declaration
int (*p) [5];
means
The declaration
int (*p) [5];
means
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* 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?
Determine Output:
main()
{
char *str1 = "abcd";
char str2[] = "abcd";
printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));
}
Determine Output:
main()
{
char *str1 = "abcd";
char str2[] = "abcd";
printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));
}
Find the output of the following program.
void main()
{
char *msg = "hi";
printf(msg);
}
Find the output of the following program.
void main()
{
char *msg = "hi";
printf(msg);
}
Determine output:
#include <stdio.h>
void main()
{
char *p = NULL;
char *q = 0;
if(p)
printf(" p ");
else
printf("nullp");
if(q)
printf("q");
else
printf(" nullq");
}
Determine output:
#include <stdio.h>
void main()
{
char *p = NULL;
char *q = 0;
if(p)
printf(" p ");
else
printf("nullp");
if(q)
printf("q");
else
printf(" nullq");
}
char *ptr;
char myString[] = "abcdefg";
ptr = myString;
ptr += 5;
what string does ptr point to in the sample code above?
char *ptr;
char myString[] = "abcdefg";
ptr = myString;
ptr += 5;
what string does ptr point to in the sample code above?
What is the base data type of a pointer variable by which the memory would be allocated to it?
What is the base data type of a pointer variable by which the memory would be allocated to it?
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)++;
}
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 will be printed after compiling and running the following code?
main()
{
char *p;
printf("%d %d",sizeof(*p), sizeof(p));
}
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?
main()
{
char *p;
p = "Hello";
printf("%cn",*&*p);
}
What will be the output?
main()
{
char *p;
p = "Hello";
printf("%cn",*&*p);
}
Comment on the following?
const int *ptr;
Comment on the following?
const int *ptr;
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);
}
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);
}
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);
}
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);
}
Choose the best answer.
Prior to using a pointer variable
Choose the best answer.
Prior to using a pointer variable
Comment on the following pointer declaration?
int *ptr, p;
Comment on the following pointer declaration?
int *ptr, p;
The statement
int **a;
The statement
int **a;
Find the output of the following program.
void main()
{
int i=10;
int *ip=&i;
int **ipp=&&i;
printf("%x,%x,%x", &i, ip, *ipp);
}
Find the output of the following program.
void main()
{
int i=10;
int *ip=&i;
int **ipp=&&i;
printf("%x,%x,%x", &i, ip, *ipp);
}
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));
}
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));
}
The operator > and < are meaningful when used with pointers, if
The operator > and < are meaningful when used with pointers, if
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()
{
printf("%d, %d", sizeof(int *), sizeof(int **));
}
Determine Output:
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
Determine Output:
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
#include<stdio.h>
void main()
{
int *ptr, a=10;
ptr = &a;
*ptr += 1;
printf("%d, %d", *ptr, a);
}
#include<stdio.h>
void main()
{
int *ptr, a=10;
ptr = &a;
*ptr += 1;
printf("%d, %d", *ptr, a);
}
The address operator &, cannot act on
The address operator &, cannot act on
Which of the following is the correct way of declaring a float pointer:
Which of the following is the correct way of declaring a float pointer: