C Programming Interview Questions
• Are expressions arr and *arr same for array of integers?
• Are variables argc and argv are local to main?
• Bitwise operator for checking whether particular bit is on or off?
• Bitwise operator for putting on particular bit in number?
• Bitwise operator for turning off particular bit in number?
• Can Structure contain Pointer to itself?
• Can there be at least some solution to determine number of arguments passed to variable argument list function?
• Can we specify variable field width in scanf() format string? If possible how?
• Can you dynamically allocate arrays in expanded memory?
• Can you use function fprintf() to display output on screen?
• Can you write function similar to printf()?
• Describe about storage allocation and scope of global, extern, static, local and register variables?
• Difference : Strings and Arrays?
• Difference : Structure and Unions?
• Difference : arrays and linked list?
• Difference : enumeration and set of pre-processor # defines?
• Difference : functions memmove() and memcpy()?
• Difference : functions rand(), random(), srand() and randomize()?
• Difference : main() in C and main() in C++?
• Difference : pass by reference and pass by value?
• Difference : strdup and strcpy?
• Differentiate between for loop and while loop? it uses?
• Does mentioning array name gives base address in all contexts?
• Does there exist any other function that can be used to convert integer or float to string?
• Does there exist any way to make command line arguments available to other functions without passing them as arguments to function?
• Explain one method to process entire string as one unit?
• How are Structure passing and returning implemented by complier?
• How can called function determine number of arguments that have been passed to it?
• How can we check whether contents of two structure variables are same or not?
• How can we read/write Structures from/to data files?
• How much maximum can you allocate in single call to malloc()?
• How will you declare array of three function pointers where each function receives two ints and returns float?
• If we want that any wildcard characters in command line arguments should be appropriately expanded, are we required to make any special provision? If yes, that?
• In header file whether functions are declared or defined?
• In header files whether functions are declared or defined?
• Increase size of dynamically allocated array?
• Increase size of statically allocated array?
• Out of fgets() and gets() that function is safe to use and why?
• Program : compare two strings without using strcmp() function.
• Program : concatenate two strings.
• Program : find Factorial of number.
• Program : generate Fibonacci Series?
• Program : interchange variables without using third one.
• Program : s for String Reversal. same for Palindrome check.
• Program : that employs Recursion?
• Program : that uses command line arguments.
• Program : that uses functions like strcmp(), strcpy(), etc.
• To that numbering system can binary number be easily converted to?
• Use bsearch() function to search name stored in array of pointers to string?
• Use functions fseek(), freed(), fwrite() and ftell()?
• Use functions memcpy(), memset(), memmove()?
• Use functions randomize() and random()?
• Use functions sin(), pow(), sqrt()?
• Use qsort() function to sort array of structures?
• Use qsort() function to sort name stored in array of pointers to string?
• What advantages of using Unions?
• What do functions atoi(), itoa() and gcvt() do?
• What do ‘c’ and ‘v’ in argc and argv stand for?
• What does error ‘Null Pointer Assignment’ mean and what causes this error?
• What does static variable mean?
• What is NULL Macro? Difference : NULL Pointer and NULL Macro?
• What is NULL Pointer? Whether it is same as uninitialized pointer?
• What is far pointer? where we use it?
• What is linklist and why do we use it when we have arrays? – I feel correct answer should be linklist is used in cases where you don’t know memory required to store data structure and need to allocate is dynamically on demand.
• What is maximum combined length of command line arguments including space between adjacent arguments?
• What is near, far and huge pointers? How many bytes are occupied by them?
• What is object file? How can you access object file?
• What is pointer?
• What is recursion?
• What is similarity between Structure, Union and enumeration?
• What is static identifier?
• What is structure?
• What is use of typedef?
• When reallocating memory if any other pointers point into same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
• Where are auto variables stored?
• Where does global, static, local, register variables, free memory and C Program instructions get stored?
• Write down equivalent pointer expression for referring same element a[i][j][k][l]?
• advantages of using pointers in program?
• advantages of using typedef in program?
• bit fields? What is use of bit fields in Structure declaration?
• declare following: array of three pointers to chars, array of three char pointers, pointer to array of three chars, pointer to function that receives int pointer and returns float pointer, pointer to function that receives nothing and returns nothing
• detect loop in linked list?
• differences between malloc() and calloc()?
• differences between structures and arrays?
• different storage classes in C?
• dynamically allocate one-dimensional and two-dimensional array of integers?
• enumerations?
• implement substr() function that extracts sub string from given string?
• macros? advantages and disadvantages?
• obtain current time and Difference : two times?
• obtain segment and offset addresses from far address of memory location?
• print string on printer?
• register variables? advantage of using register variables?
• that function should be used to free memory allocated by calloc()?
• that header file should you include if you are to develop function that can accept variable number of arguments?


This entry was posted on 9:36 AM and is filed under . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

0 comments: