C-Pointers Question and Answer
C-Pointers Question and Answer
131. Find the output
void main ( )
{
int i=4, j=-3;
mul (&i, j);
printf ("%d %d", i, j);
}
mu1 (int *a, int b)
{
*a=*a **a;
b=b*b;
}
void main ( )
{
int i=4, j=-3;
mul (&i, j);
printf ("%d %d", i, j);
}
mu1 (int *a, int b)
{
*a=*a **a;
b=b*b;
}
- 4 3
- 4 9
- 16 -3
- None of these
132. Find the out
#include "studio.h"
void main ( )
{
printf ("%d %d"),
sizeof (NULL), sizeof (" "));
}
#include "studio.h"
void main ( )
{
printf ("%d %d"),
sizeof (NULL), sizeof (" "));
}
- 0 0
- 1 1
- 2 1
- 1 2
133. Where can pointers be used
I. Dynamic memory allocation'
II. Call by reference
III. Implementing trees
IV. Accessing string elements
I. Dynamic memory allocation'
II. Call by reference
III. Implementing trees
IV. Accessing string elements
- only I & II
- only III &IV
- I, II &IV
- All of these
134. What is the size of pointer if memory model is compact in Turbo C?
- 1 byte
- 2 byte
- 4 byte
- None of these
135. Find the output
void main ( )
{
int a=5, *p=&a;
a=XXX (&p);
printf ("%d %d", a, *p);
}
XXX (int **p)
{
int b= **p***p;
}
void main ( )
{
int a=5, *p=&a;
a=XXX (&p);
printf ("%d %d", a, *p);
}
XXX (int **p)
{
int b= **p***p;
}
- 25 25
- 5 65524
- Garbage value
- Compilation eror
136. The poitner which is created in data segment and holds the address within data segment is known as:
- Near pointer
- Bad pointer
- Smart pointer
- None of these
137. What is the difference between ++*p and *p++?
- In both cases pointers are incremented.
- In both cases values are incremented.
- In first case value is incremented and in second case pointer is incremented.
- In first case pointers is incremented and in second case value is incremented.
138. EP_SEG( ), FP_OFF ( ) are declared in which header file ?
- sys.h
- dos.h
- stdio.h
- offset.h
139. What is the formula to find real address ?
- segment address *16+offset address
- Segment address+offset address *16
- Segment address*10+offset address
- Segment address+ofset address*10
140. What happens when far address is incremented ?
- Only segment address is incremented.
- Only offset address is incremented.
- Both segment and offset address are incremented.
- None of these