FreeJobAlert.Com

Government Jobs | Results | Admit Cards

c language interview questions | Part4

If you would like to view All C language interview questions only at one place visit below link
All C Language Interview Questions

31. What is near pointer?
Ans: A near pointer is 16 bits long. It uses the current content of the CS (code segment) register (if
the pointer is pointing to code) or current contents of DS (data segment) register (if the pointer is pointing to data) for the segment part, the offset part is stored in a 16 bit near pointer. Using near pointer limits the data/code to 64kb segment.

32. In C, why is the void pointer useful? When would you use it?
Ans: The void pointer is useful because it is a generic pointer that any pointer can be cast into and
back again without loss of information.

33. What is a NULL Pointer? Whether it is same as an uninitialized pointer?
Ans: Null pointer is a pointer which points to nothing but uninitialized pointer may point to anywhere.

34. Are pointers integer?
Ans: No, pointers are not integers. A pointer is an address. It is a positive number.

35. What does the error ‘Null Pointer Assignment’ means and what causes this error?
Ans: As null pointer points to nothing so accessing a uninitialized pointer or invalid location may cause an error.

36. What is generic pointer in C?
Ans: In C void* acts as a generic pointer. When other pointer types are assigned to generic pointer,
conversions are applied automatically (implicit conversion).

37. Are the expressions arr and &arr same for an array of integers?
Ans: Yes for array of integers they are same.

38. IMP>How pointer variables are initialized?
Ans: Pointer variables are initialized by one of the following ways.
I. Static memory allocation
II. Dynamic memory allocation

39. What is static memory allocation?
Ans: Compiler allocates memory space for a declared variable. By using the address of operator, the
reserved address is obtained and this address is assigned to a pointer variable. This way of assigning pointer value to a pointer variable at compilation time is known as static memory allocation.

40. What is dynamic memory allocation?
Ans: A dynamic memory allocation uses functions such as malloc() or calloc() to get memory dynamically. If these functions are used to get memory dynamically and the values returned by these function are assigned to pointer variables, such a way of allocating memory at run time is known as dynamic memory allocation.

Related Fresher Interview Questions

1. C Language Interview Questions
2. C++ Language Interview Questions
3. Data Structures Interview Questions
4. DBMS Interview Questions
5. Operating System Interview Questions
6. UNIX Interview Questions

Tags: c fresher interview questions, c interview, c interview questions, c interview questions and answers, c interview questions and answers for freshers, c interview questions for freshers, c interview questions with answers, c language interview questions, c language interview questions and answers, fresher interview questions, fresher interview questions and answers, fresher interview questions and answers on c, fresher interview questions on c, fresher interview questions with answers, interview questions on c, it fresher interview questions, it fresher interview questions and answers, questions for interview, questions on c

Responses to “c language interview questions | Part4”

  1. Very helpful site. Nice content. Thanks to this site.

Leave a Comment