Currently Browsing : C.

  • C Programming Interview Answers 1 to 10

    1. What does static variable mean? Ans: Static variables are the variables which retain their values between the function calls. They are initialized only once their scope is within the function in which they are defined. 2. What is a pointer? Ans: Pointers are variables which stores the address of another variable. That variable may be a scalar (including another pointer), or an aggregate (array or structure). The pointed-to object may…

    View Details
  • C Programming Interview Answers 11 to 20

    11. Difference between pass by reference and pass by value? Ans: Pass by reference passes a pointer to the value. This allows the callee to modify the variable directly.Pass by value gives a copy of the value to the callee. This allows the callee to modify the value without modifying the variable. (In other words, the callee simply cannot modify the variable, since it lacks a reference to it.) 12. What…

    View Details
  • C Programming Interview Answers 21 to 30

    21. Out of fgets() and gets() which function is safe to use and why? Ans: fgets() is safer than gets(), because we can specify a maximum input length. Neither one is completely safe, because the compiler can’t prove that programmer won’t overflow the buffer he pass to fgets (). 22. Difference between strdup and strcpy? Ans: Both copy a string. strcpy wants a buffer to copy into. strdup allocates a buffer…

    View Details
  • C Programming Interview Answers 31 to 40

    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….

    View Details
  • C Programming Interview Answers 41 to 50

    41. What is the purpose of realloc? Ans: It increases or decreases the size of dynamically allocated array. The function realloc (ptr,n) uses two arguments. The first argument ptr is a pointer to a block of memory for which the size is to be altered. The second argument specifies the new size. The size may be increased or decreased. If sufficient space is not available to the old region the function…

    View Details
  • C Programming Interview Answers 51 to 60

    51. Difference between formal argument and actual argument? Ans: Formal arguments are the arguments available in the function definition. They are preceded by their own data type. Actual arguments are available in the function call. These arguments are given as constants or variables or expressions to pass the values to the function. 52. Is it possible to have more than one main() function in a C program ? Ans: The function…

    View Details
  • C Programming Interview Answers 61 to 70

    61. What do the ‘c’ and ‘v’ in argc and argv stand for? Ans: The c in argc(argument count) stands for the number of command line argument the program is invoked with and v in argv(argument vector) is a pointer to an array of character string that contain the arguments. 62. IMP>what are C tokens? Ans: There are six classes of tokens: identifier, keywords, constants, string literals, operators and other separators….

    View Details
  • C Programming Interview Answers 71 to 80

    71. What are the two forms of #include directive? Ans: 1.#include”filename” 2.#include the first form is used to search the directory that contains the source file.If the search fails in the home directory it searches the implementation defined locations.In the second form ,the preprocessor searches the file only in the implementation defined locations. 72. How would you use the functions randomize() and random()? Ans: Randomize() initiates random number generation with a…

    View Details
  • C Programming Interview Answers 81 to 90

    81. What is a file pointer? Ans: The pointer to a FILE data type is called as a stream pointer or a file pointer. A file pointer points to the block of information of the stream that had just been opened. 82. How is fopen()used ? Ans: The function fopen() returns a file pointer. Hence a file pointer is declared and it is assigned as FILE *fp; fp= fopen(filename,mode); filename is…

    View Details
  • C Programming Interview Answers 91 to 106

    91. What are the pointer declarations used in C? Ans: 1- Array of pointers, e.g , int *a[10]; Array of pointers to integer 2-Pointers to an array,e.g , int (*a)[10]; Pointer to an array of into 3-Function returning a pointer,e.g, float *f( ) ; Function returning a pointer to float 4-Pointer to a pointer ,e.g, int **x; Pointer to apointer to int 5-pointer to a data type ,e.g, char *p; pointer…

    View Details

Why Us : At the leading career guidance portal, get updates & study material of latest government jobs, entrance exams, admit card, college admissions, syllabus, results, talent search exams, olympiads & more.
Content Disclaimer : The content of this website is provided for information purposes only, we are not responsible for any mistakes. If found any mistakes in this page, please E-mail us to [email protected]