Pointer interview questions in c

Pointer interview questions and answer in c programming language

1. What is wild pointer?
7. What are demerits of pointers?


baskara said...

answers for above questions

surya said...

how 2 find answer for above questions


varma said...

i need more c progam qustns(not puzzles)
need name of pgm

Anonymous said...

Wild pointer=A pointer pointing to an invalid address for exp.
int *p=0x23ac45;
The assigned address may be valid or invalid r/w to this address leads to segmentation fault.
also int *p;
p is pointing to an invalid address beware using them.

Anonymous said...

generic pointer :- A pointer to void is said to be generic pointer.The most important feature of generic pointer is that it can store the address of any kind of variable may be int,char,float double etc. But int *p can store only the address of integer variable.like char *p can store only the address of char variable etc.

Anonymous said...

Far Pointer :- A pointer created in one segment allcating memory from another segment is called far pointer.
exp :- char far *p=OxB8000000;
They are no more used bcoz of a lot of issues associated with the turbo C compiler .There is no near,far or huge in gcc compiler.

Anonymous said...

Apart from complex code there is no disadvantage in using a pointer.

Anonymous said...

we have heard that pointers can hold the address of integers ,characters ,floats etc. also a pointer can hold the address of function exp (*p)();In using this prototype is compulsory.

Anonymous said...

Array of intergers int a[5];
array of characters char str[40];

Array of addresses are called as array of pointers.
char *names[89];
It has a numerous advantages over 2D array if used with the strings .

Anonymous said...

It is 100% true to say that "Every array name and function names are constant pointers".

int a[5];
int * const p=(int *)malloc(5 * sizeof(int));

The above two statements dont have exactly a single difference.

Prince Vijay Pratap said...
This comment has been removed by the author.
Prince Vijay Pratap said...

Except one, which is former one is stored in temporary section of memory i.e STACK which is freed by compiler automatically after the end of program and the latter one is stored in HEAP section of memory which we have to explicitly free it by calling free function in c and delete operator in c++.