Pointers Questions and Answers
Practice ModeShowing 10 of 217 questions
Q181
Find the output
void main ()
const * ptr=(const*) "SHYMLI";
ptr+=2;
printf("%s", ptr);
}
Answer: Option C
Q182
Find the output
void main ( )
char *p="Hi Bye";
printf("*%s*", p);
}
Answer: Option B
Q183
Find the output
void test (int, int*);
void main ()
{
int *iptr, j, k=2;
iptr=&j;
j=k;
printf("%d %d", k,j);
test (j, iptr);
printf ("%d %d", k,j);
}
void test (int 1, int *p)
{
1++;
(*p)++;
}
Answer: Option C
Q184
When a pointer points to zero or base address of a segment is called
Answer: Option A
Q185
Find the output
void main ( )
{
char *str1="D.A.V. \0 SHYAMLI";
char *str2[20];
strcpy (str2, str1);
printf("%s", str2);
}
Answer: Option B
Q186
Which of the following is true about the following code :
#include "alloc.h"
void main ()
{
printf ("The size of heap is =%u Bytes", coreleft( ) );
}
Answer: Option B
Q187
Find the output
void main ( )
{
int x=440; int **q;
const **p=* (&x);
q=*(&p)+60;
printf("%d", q);
}
Answer: Option B
Q188
Which of the following is true ?
Answer: Option C
Q189
Without the knowledge of pointer if memory is de-allocated it will be
Answer: Option B
Q190
Attempts to write data in a read only location is called
Answer: Option A