7. What are demerits of pointers?
10. Array name is constant pointer. Is it true?
C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf
12 comments:
answers for above questions
how 2 find answer for above questions
www.forum.symphoniks.com
i need more c progam qustns(not puzzles)
need name of pgm
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.
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.
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.
Apart from complex code there is no disadvantage in using a pointer.
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.
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 .
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.
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++.
Post a Comment