|
C Interview Questions and Answers
Are you a developer? Need to update your software development knowledge or need to prepare for a job interview?
Check out this collection of C Interview Questions and Answers...
C Interview Questions and Answers
- What is C language?
- What is Duff's Device?
- Here is a good puzzle: how do you write a program which produces its own source code as output?
- Suggesting that there can be 62 seconds in a minute?
- Was 2000 a leap year?
- How can I find the day of the week given the date?
- What is hashing?
- I need a sort of an approximate strcmp routine ...
- What are the differences between C and CPP?
- How can I call FORTRAN?
- What is assert and when would I use it?
- Why doesnt C have nested functions?
- Does C have an equivalent to Pascals with statement?
- If the assignment operator were ...
- Is C a great language, or what?
- Does C have circular shift operators?
- There seem to be a few missing operators ...
- Why isnt there a numbered, multi-level break statement to break out
- Why dont C comments nest?
- Are the outer parentheses in return statements really optional?
- Is there a way to have non-constant case labels (i.e. ranges or arbitrary expressions)?
- Is there a way to switch on strings?
- Which is more efficient, a switch statement or an if else chain?
- How can I swap two values without using a temporary?
- People claim that optimizing compilers are good and that we no longer have to write things in assembler for speed
- I have been replacing multiplications and divisions with shift operators, because shifting is more efficient.
- Are pointers really faster than arrays?
- What is the best way of making my program efficient?
- What is the most efficient way to count the number of bits which are set in an integer?
- Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
- How can I convert integers to binary or hexadecimal?
- How do I swap bytes?
- How can I determine whether a machines byte order is big-endian or little-endian?
- How can I implement sets or arrays of bits?
- How can I manipulate individual bits??
- If I have a char * variable pointing to the name of a function ...
- How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
- What is the right way to use errno?
- What is a good data structure to use for storing lines of text?
- How can I return multiple values from a function?
- Why isnt any of this standardized in C? Any real program has to do some of these things.
- But I cant use all these nonstandard, system-dependent functions, because my program has to be ANSI compatible!
- What are near and far pointers?
- I am trying to compile this program
- How can I ensure that integer arithmetic doesnt overflow?
- How can I handle floating-point exceptions gracefully?
- How can I trap or ignore keyboard interrupts like control-C?
- How can I implement a delay, or time a users response, with sub-second resolution?
- How can I read in an object file and jump to locations in it?
- Is exit(status) truly equivalent to returning the same status from main?
- How can I open files mentioned on the command line, and parse option flags?
- How can a process change an environment variable in its caller?
- How can I automatically locate a programs configuration files in the same directory as the executable?
- How can my program discover the complete pathname to the executable from which it was invoked?
- How can I invoke another program or command and trap its output?
- How do I get an accurate error status return from system on MS-DOS?
- How can I call system when parameters (filenames, etc.) of the executed command arent known until run time?
- How can I invoke another program (a standalone executable, or an operating system command) from within a C program?
- How can I do PEEK and POKE in C?
- I thought that using large model meant that I could use more than 64K of data!
- How can I allocate arrays or structures bigger than 64K?
- How can I find out how much memory is available?
- How do I create a directory? How do I remove a directory (and its contents)?
- How can I read a directory in a C program?
- How can I find out how much free space is available on disk?
- How can I increase the allowable number of simultaneously open files?
- How can I suppress the dreaded MS-DOS Abort, Retry, Ignore? message?
- fopen isnt letting me open files like "$HOME/.profile" and "~/.myrcfile".
- Why cant I open a file by its explicit path?
- How do I copy files?
- How can I delete a file?
- How can I recover the file name given an open stream or file descriptor?
- ow can I insert or delete a line (or record) in the middle of a file?
- How can I find the modification date and time of a file?
- How can I find out the size of a file, prior to reading it in?
- How can I check whether a file exists? I want to warn the user if a requested input file is missing.
- How can I send mail from within a C program?
- How can I do graphics?
- How can I access an I O board directly?
- How do I send escape sequences to control a terminal or other device?
- How can I direct output to the printer?
- How can I do serial comm port I O?
- How do I read the arrow keys? What about function keys?
- How can I make it pause before closing the program output window?
- How can I clear the screen? How can I print text in color? How can I move the cursor to a specific x, y position?
- ow can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
- How can I find out if there are characters available for reading?
- How can I read a single character from the keyboard without waiting for the RETURN key?
- I need code to parse and evaluate expressions.
- Dont ANSI function prototypes render lint obsolete?
- Where can I get an ANSI-compatible lint?
- How can I shut off the warning ...
- I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
- People always say that good style is important
- Some people say that gotos are evil and that I should never use them. Isnt that a bit extreme
- What is Hungarian Notation? Is it worthwhile?
- Should I use symbolic names like TRUE and FALSE for Boolean constants, or plain 1 and 0?
- If NULL and 0 are equivalent as null pointer constants, which should I use?
- I came across some code that puts a (void) cast before each call to printf. Why?
- I have seen function declarations that look like this
- Why do some people write if(0 == x) instead of if(x == 0)?
- Here is a neat trick for checking whether two strings are equal
- How should functions be apportioned among source files?
- What is the best style for code layout in C?
- What do Segmentation violation, `Bus error, and General protection fault mean? What is a core dump?
- I have got some code that is trying to unpack external structures
- Why does this code crash?
- This program runs perfectly on one machine ...
- I have a program that seems to run correctly
- This program crashes before it even runs!
- Why isnt my procedure call working? The compiler seems to skip right over it
- I am getting baffling syntax errors which make no sense at all
- Why is this loop always executing once?
- How can I call a function with an argument list built up at run time?
- How can I write a function which takes a variable number of arguments
- I cant get va_arg to pull in an argument of type pointer-to-function.
- I have a varargs function which accepts a float parameter
- My compiler isnt letting me declare a function
- How can I discover how many arguments a function was actually called with?
- I have a pre-ANSI compiler, without stdarg.h What can I do?
- How can I write a function analogous to scanf
- How can I write a function that takes a format string and a variable number of arguments
- How can I write a function that takes a variable number of arguments?
- I had a frustrating problem which turned out to be caused by the line
- How can f be used for both float and double arguments in printf? Aren't they different types?
- I heard that you have to include stdio.h before calling printf. Why?
- I am having trouble with a Turbo C program which crashes
- What is a good way to implement complex numbers in C?
- How can I handle floating-point exceptions gracefully?
- How do I set variables to, or test for IEEE NaN?
- The predefined constant M_PI seems to be missing from my machines copy of math.h.
- Why doesn't C have an exponentiation operator?
- How do I round numbers?
- What is a good way to check for ``close enough'' floating-point equality?
- I am sure I've got the trig functions declared correctly, but they are still giving me wrong answers.
- My floating-point calculations are acting strangely and giving me different answers on different machines.
- I am trying to do some simple trig...
- I am trying to take some square roots
- When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
- My compiler is complaining that printf is undefined ...
- What does it mean when the linker says that _end is undefined?
- Why is my simple program, which hardly does more than print
- I am still getting errors due to library functions being undefined
- I keep getting errors due to library functions being undefined, but I am including all the right header files.
- I am trying to port this old program. Why do I get undefined external errors for some library functions?
- What is the difference between memcpy and memmove?
- Is exit(status) truly equivalent to returning the same status from main?
- I am porting this program, and it calls a routine drand48, which my library doesnt have. What is it?
- How can I generate random numbers with a normal or Gaussian distribution?
- How can I generate floating-point random numbers?
- How can I return a sequence of random numbers which dont repeat at all?
- I need a random true/false value ...
- Each time I run my program, I get the same sequence of numbers back from rand
- How can I get random integers in a certain range?
- I need a random number generator.
- Did C have any Year 2000 problems?
- How can I add N days to a date? How can I find the difference between two dates?
- I know that the library function localtime will convert ...
- How can I get the current date or time of day in a C program?
- How can I sort more data than will fit in memory?
- How can I sort a linked list?
- Now I am trying to sort an array of structures with qsort ...
- I am trying to sort an array of strings with qsort, using strcmp as the comparison function, but it is not working.
- I need some code to do regular expression and wildcard matching.
- How can I split up a string into whitespace-separated fields?
- Why do some versions of toupper act strangely if given an upper-case letter?
- How do I convert a string to all upper or lower case?
- Does C have anything like the `substr (extract substring) routine present in other languages?
- Why does strncpy not always place a \0 terminator in the destination string?
- How can I convert numbers to strings (the opposite of atoi)? Is there an itoa function?
- why isnt it being handled properly?
- How can I write code to conform to these old, binary data file formats?
- How can I read/write structures from/to data files?
- What is the difference between text and binary I/O?
- How can I change their mode to binary?
- How can I read a binary data file properly?
- I want to read and write numbers between files and memory ...
- ow can I arrange to have output go two places at once, e.g. to the screen and to a file?
- How can I get back to the interactive keyboard if stdin is redirected?
- How can I tell if standard input or output is redirected
- Once I have used freopen, how can I get the original stdout (or stdin) back?
- How can I redirect stdin or stdout to a file from within a program?
- How can I recover the file name given an open stream?
- How can I insert or delete a line (or record) in the middle of a file?
- I am trying to update a file in place ...
- How can I open files with names like ...
- I cant even get a simple fopen call to work
- I wrote this routine which is supposed to open a fil
- If fflush wont work, what can I use to flush input?
- How can I flush pending input so that a user ...
- What is the difference between fgetpos/fsetpos and ftell/fseek? What are fgetpos and fsetpos good for?
- I thought I would check errno after a long string of printf calls
- Why does everyone say not to use gets?
- What is the deal on sprintfs return value?
- How can I tell how much destination buffer space ...
- I figured I could use scanf more safely if I checked its ...
- I am using scanf c to read a Y/N response
- Why does everyone say not to use scanf? What should I use instead?
- I am reading a number with scanf and d, and then a string with gets
- When I read numbers from the keyboard with scanf ...
- How can I read data from data files with particular formats?
- How can I specify a variable width in a scanf format string?
- Why doesnt that code work?
- Why doesnt this code work?
- Why does the call char scanf work?
- WWhy doesnt the call scanf work?
- How can I print numbers with commas separating the thousands? What about currency formatted numbers?
- How can I implement a variable field width with printf?
- What printf format should I use for a typedef like size_t when I don't know whether it is long or some other type?
- How can printf use f for type double, if scanf requires lf?
- I thought that ANSI function prototypes were supposed to guard against argument type mismatches.
- Why doesnt long int work?
- ow can I print a character in a printf format string?
- How can I read one character at a time, without waiting for the RETURN key
- My programs prompts and intermediate output dont always show up on the screen ...
- Why do all the lines end up containing copies of the last line?
- Why does the simple line-copying loop while
- I have a simple little program that reads characters until EOF
- What is wrong with this code?
- People keep saying that the behavior of ...
- I am appalled that the ANSI Standard leaves so many issues undefined ...
- What does it really mean for a program to be legal or `valid or ``conforming?
- People seem to make a point of distinguishing between ...
- Why wont the Frobozz Magic C Compiler ...
- Does anyone have a tool for converting old-style C programs to ANSI C?
- WWhy are some ANSI ISO Standard library functions showing u
- What does the message Automatic aggregate intialization is an ANSI feature mean?
- Wy compiler is rejecting the simplest possible test programs ...
- What was noalias and what ever happened to it?
- Why does the ANSI Standard place limits on the length and case-significance of external identifiers?
- What should malloc0 do? Return a null pointer or a pointer to 0 bytes?
- What is the difference between memcpy and memmove?
- Why cant I perform arithmetic on a void pointer?
- Since array references decay into pointers ...
- What does it mean?
- WWhat does pragma once mean? I found it in some header files.
- What are pragmas and what are they good for?
- I am getting strange syntax errors inside lines I have ifdeffed out.
- What does the message warning macro replacement within a string literal mean?
- I am trying to use the ANSI stringizing preprocessing operator ...
- Is exit status truly equivalent to returning the same status from main?
- So what could go wrong? Are there really any systems where void main doesnt work?
- I believe that declaring void main) cant fail ...
- But what about main's third argument, envp?
- Can I declare main as void, to shut off these annoying
- What is the correct declaration of main?
- hat is the difference between
- Why is p turning out const, instead of the characters pointed to?
- Why cant I pass a char to a function which expects a const char ?
- What is the difference between const char
- If you cant modify string literals, why arent they defined as being arrays of const characters?
- I dont understand why I cant use const values in initializers
- I heard that you have to include
- I had a frustrating problem which turned out to be caused by the line
- Why does the declaration extern int
- Can you mix old-style and new-style function syntax?
- My ANSI compiler complains about a mismatch when it sees
- What is the ANSI C Standard?
- How can I include expansions of the macros
- How can I write a macro which takes a variable number of arguments
- I have got this tricky preprocessing I want to do and I cant figure out a way to do it.
- I am trying to use the ANSI stringizing preprocessing operator
- How can I use a macro argument inside a string literal in the macro expansion?
- Why is the macro giving me the warning
- I have an old macro that doesn't seem to work any more.
- I have some old code that tries to construct identifiers with a macro like
- How can I list all of the predefined identifiers?
- I inherited some code which contains far too many ...
- I a'm getting strange syntax errors inside lines I have ifdeffed out.
- How can I use a preprocessorif expression to ?
- Is there anything like an ifdef for typedefs?
- Can I use an ifdef in a #define line
- Does the sizeof operator work in preprocessor if directives?
- How can I construct preprocessor if expressions which compare strings?
- I mm compiling a program, and I seem to be missing one of the header files it requires
- I am including the right header file for the library function I am using, but the linker keeps saying its undefined.
- I am using header files which accompany two different third-party libraries...
- I am getting strange syntax errors on the very first declaration in a file, but it looks fine.
- What are the complete rules for header file searching?
- What's the difference between...?
- Is it acceptable for one header file to #include another?
- I am splitting up a program into multiple source files for the first time
- What is the difference between
- What's the difference between using a typedef or a define for a user-defined type?
- What's the best way to write a multi-statement macro?
- How can I write a generic macro to swap two values?
- I can write C code that looks more like Pascal?
- I am trying to define a few simple little function-like macros ...
- A third-party header file I just started using is defining its own TRUE and FALSE values incompatibly
- Should I use symbolic names like TRUE and FALSE for Boolean constants, or plain 1 and 0?
- Is if(p), where p is a pointer, a valid and portable test?
- What if a built-in logical or relational operator `returns something other than 1?
- What is the right type to use for Boolean values in C?
- I am starting to think about multinational character sets
- I think somethings wrong with my compiler
- I am reading strings typed by the user into an array
- Does C have anything like the `substr extract substrin routine present in other languages?
- How can I get the numeric value corresponding to a character?
- What is the difference between these initializations?
- I cant get strcat to work. I tried
- If I can say... why can't I say...
- I am checking a string to see if it matches a particular value...
- Why doesnt strcat work?
- What is alloca and why is its use discouraged?
- What is the difference between calloc and malloc?
- Is it legal to pass a null pointer as the first argument to realloc? Why would you want to?
- Having dynamically allocated an array , can I change its size?
- Why doesn't sizeof tell me the size of the block of memory pointed to by a pointer?
- So can I query the malloc package to find out how big an allocated block is?
- How does free know how many bytes to free?
- I have a program which mallocs and later frees a lot of memory
- WMust I free allocated memory before the program exits?
- I am allocating structures which contain pointers to other dynamically
- When I call malloc to allocate memory for a pointer which is local to a function
- Why isn't a pointer null after calling free?
- You cant use dynamically-allocated memory after you free it?
- I im dynamically allocating an array, like this
- y program is crashing, apparently somewhere down inside malloc
- My application depends heavily on dynamic allocation of nodes for data structures
- Why can I only seem to malloc 640K or so?.
- I am allocating a large array for some numeric work ...
- malloc is returning crazy pointer values ...
- I have heard that some operating systems dont actually allocate...
- Return a null pointer or a pointer to 0 bytes?
- How can I find out how much memory is available?
- How can I dynamically allocate arrays?
- How can I shut off the warning: possible pointer alignment problem ...
- What is wrong with this initialization?
- I im trying to declare a pointer and allocate some space for it
- I wrote a little wrapper around malloc ...
- I see code like ...
- In a call to malloc, what does an error like
- What is wrong with casting mallocs return value?
- Why does some code carefully cast the values returned by malloc to the pointer type being allocated?
- Why am I getting warning assignment of pointer?
- So what is the right way to return a string or other aggregate?
- I have a function that is supposed to return a string ...
- I am reading lines from a file into an array ...
- How much memory does a pointer variable allocate?
- I just tried the code Why didn't it crash?
- How am I supposed to know to allocate things?
- I cant get strcat to work. I tried ...
- Why doesn't this fragment work?
- Is there a way to have an array of bits?
- I want to know how many elements are in an array, but sizeof yields the size in bytes.
- How can code in a file where an array is declared as extern
- Why doesnt sizeof properly report the size of an array
- How can I use statically- and dynamically-allocated multidimensional arrays?
- How do I write functions which accept two-dimensional arrays when the width is not known at compile time?
- My compiler complained when I passed a two-dimensional array
- I can treat array as if it were a 1-based array ...
- How can I dynamically allocate a multidimensional array?
- How can I declare local arrays of a size matching a passed-in array?
- How can I set an array's size at run time?
- How do I declare a pointer to an array?
- Since array references decay into pointers ...
- How can this be legal C?
- Is a pointer a kind of array?
- Someone explained to me that arrays were really just constant pointers.
- Practically speaking, what is the difference between arrays and pointers?
- How can an array be an lvalue, if you can't assign to it?
- And what about this? Isn't this an array assignment?
- If you can't assign to arrays, then how can
- Why can't I do something like this?
- So arrays are passed by reference...
- Why are array and pointer declarations interchangeable....?
- So what is meant by the `equivalence of pointers and arrays in C?
- But I heard that char a[] was identical to char *a.
- I had the definition char a6 in one source file
- What does a run-time null pointer assignment error mean?
- How can I access an interrupt vector located at the machines location 0?
- Is a run-time integral value of 0, cast to a pointer, guaranteed to be a null pointer?
- Seriously, have any actual machines really used nonzero null pointers ...
- Given all the confusion surrounding null pointers
- I am confused. I just can't understand all this null pointer stuff
- Why is there so much confusion surrounding null pointers?
- This is strange. NULL is guaranteed to be 0, but the null pointer is not?
- I use the preprocessor macro...
- I once used a compiler that wouldn't work unless NULL was used.
- But wouldnt it be better to use NULL
- If NULL and 0 are equivalent as null pointer constants, which should I use?
- Is NULL valid for pointers to functions?
- My vendor provides header files that define NULL as 0L. Why?
- If NULL were defined as follows
- How should NULL be defined on a machine
- What is NULL and how is it defined?
- Is the abbreviated pointer comparison ...
- How do I get a null pointer in my programs?
- What is this infamous null pointer, anyway?
- What are near and far pointers?
- What is wrong with this declaration?
- WHow do I convert an int to a char
- How are integers converted to and from pointers?
- What is the total generic pointer type?
- I have seen different syntax used for calling functions via pointers ...
- Does C even have -`pass by reference?
- I have a function ...
- Suppose I want to write a function that takes a generic pointer ...
- I have a function which accepts ...
- I have got some code that is trying to unpack external structures
- Why can't I perform arithmetic on a void pointer?
- I have a char pointer that happens to point to some ints
- I am trying to use pointers to manipulate an array of ints
- What it points to?
- I am trying to declare a pointer and allocate some space for it
- What are pointers really good for, anyway?
- What is the difference between the unsigned preserving and value preserving rules?
- What does the warning semantics of change in ANSI C mean?
- I have some code containing expressions like
- I have a complicated expression which I have to assign to one of two variables
- Why does the cod double ...
- How can I ensure that integer arithmetic doesnt overflow?
- Why doesnt the code
- I need to check whether one number lies between two others
- If I am not using the value of the expression?
- What's the difference between ++i and i++?
- How can I avoid these undefined evaluation order difficulties ...
- People told me that if I evaluated an undefined expression
- People keep saying that the behavior of
- So if I write ..
- How can I understand complex expressions like the ones in this section
- Why did printf ..
- Is it safe to assume that the right-hand side of the ...
- But what about... I see code like ?
- Can I use explicit parentheses to force the order of evaluation I want?
- Here's a slick expression...
- I have experimented with the code?
- Under my compiler...
- Why doesn't this code:
- Why do people use explicit masks and bit-twiddling code so much?
- I came across some structure declarations with colons ...
- Is there an easy way to print enumeration values symbolically?
- Are enumerations really portable?
- What is the difference between an enumeration?
- Is there an automatic way to keep track of which field of a union is in use?
- Can I initialize unions?
- What is the difference between a structure and a union, anyway?
- This program works correctly ...
- If an array name acts like a pointer to the base of an array ...
- Does C have an equivalent to Pascals with statement?
- How can I access structure fields by name at run time?
- How can I determine the byte offset of a field within a structure?
- Why does sizeof report a larger size than I expect for a structure type ...
- Why is my compiler leaving holes in structures ...
- How can I read/write structures from/to data files?
- How can I pass constant values to functions which accept structure arguments?
- How are structure passing and returning implemented?
- Is there a way to compare structures automatically?
- I heard that structures could be assigned to variables
- I came across some code that declared a structure like this
- Why does the declaration extern int...
- Is there a good way of simulating OOP-style inheritance
- How can I implement opaque (abstract) data types in C?
- Can a structure contain a pointer to itself?
- C is not C++. Typedef names are not automatically generated
- What's the difference between these two declarations?
- Can I initialize unions?
- I finally figured out the syntax for declaring pointers to functions
- It is legal in ANSI C
- What is the difference between these initializations?
- What is wrong with this initialization?
- This code, straight out of a book, isnt compiling
- WWhat am I allowed to assume about the initial values of variables
- How can I determine which identifiers are safe for me to use and which are reserved?
- My compiler isnt letting me declare a big array like double array];
- I am getting strange syntax errors on the very first declaration in a file
- My compiler is complaining about mismatched function prototypes which look fine to me.
- What is the right declaration for main? Is void main() correct?
- My compiler is complaining about an invalid redeclaration of a function
- I have an extern array which is defined in one file
- Can I declare a local array of a size matching a passed-in array?
- How can I declare a function that can return a pointer to a function of the same type?
- How do I construct declarations of complicated types such as
- What does it mean for a function parameter to be const?
- What is the difference between const char *p, char const *p, and char * const p?
- I dont understand why I cant use const values in initializers and array dimensions
- What does typedef int (*funcptr)(); mean?
- Why is p turning out const, instead of the characters pointed to?
- What's the difference between these two declarations?
- How can I define a pair of mutually referential structures?
- I can not seem to define a linked list successfully
- What is the difference between using a typedef or a #define for a user-defined type?
- What is the auto keyword good for?
- What does extern mean in a function declaration?
- Do all declarations for the same static function?
- How can I make a sort of `semi-global variable
- How can I implement opaque (abstract) data types in C
- What is the best way to declare and define global variables and functions?
- I am trying to declare a pointer and allocate some space for it
- Why aren't the sizes of the standard types precisely defined?
- What's wrong with this declaration?
- Since C doesnt define sizes exactly
- What should the 64-bit type be on a machine that can support it?
- How should I decide which integer type to use?
- printf() Function What is the output of printf("%d")?
- malloc() Function- What is the difference between "calloc(...)" and "malloc(...)"?
- printf() Function- What is the difference between "printf(...)" and "sprintf(...)"?
- Compilation How to reduce a final size of executable?
- Linked Lists -- Can you tell me how to check whether a linked list is circular?
- "union" Data Type What’s the output of the following program? Why?
- String Processing --- Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba.
- What will print out about this code?
- What will be printed as the result of the operation below...
- What will be printed as the result of the operation below -...
- What will be printed as the result of the operation below ??
- What will be printed as the result of the operation below
- What will be printed as the result of the operation below main(){char s1[]=“Cisco”;...
- What will be printed as the result of the operation below: main(){ char *p1;...
- The following variable is available in file1.c, who can access it?: static int average;
- WHat will be the result of the following code?
- What will be printed as the result of the operation below: int x;..
- What will be printed as the result of the operation below: main(){int x=10, y=15; ...
- What will be printed as the result of the operation below:main(){ int a=0;
- What will the following piece of code do int f(unsigned int x ...
- What are x, y, y, u ???
- What does static variable mean?
- Advantages of a macro over a function?
- What are the differences between malloc() and calloc()?
- What are the different storage classes in C?
- What is the difference between strings and character arrays?
- Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
- Which bit wise operator is suitable for checking whether a particular bit is on or off?
- Which bit wise operator is suitable for turning off a particular bit in a number?
- Which bit wise operator is suitable for putting on a particular bit in a number?
- Does there exist any other function which can be used to convert an integer or a float to a string?
- Why does malloc(0) return valid memory address ? What's the use ?
- Difference between const char* p and char const* p
- How can method defined in multiple base classes with same name can be invoked from derived class simultaneously
- Write a program to interchange 2 variables without using the third one.
- What is the result of using Option Explicit?
- What is the benefit of using an enum rather than a #define constant?
- How can I open a file so that other programs can update it at the same time?
- What is hashing?
- What is the quickest sorting method to use?
- when should the volatile modifier be used?
- When should the register modifier be used? Does it really help?
- What is page thrashing?
- How can you determine the size of an allocated portion of memory?
- Can static variables be declared in a header file?
- How do you override a defined macro?
- How can you check to see whether a symbol is defined?
- Can a variable be both const and volatile?
- Can include files be nested?
- Write the equivalent expression for x%8?
- When does the compiler not implicitly generate the address of the first element of an array?
- What is the benefit of using #define to declare a constant?
- How can I search for data in a linked list?
- Why should we assign NULL to the elements (pointer) after freeing them?
- What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
- When should a type cast be used?
- What is a null pointer?
- What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
- How can I convert a string to a number?
- How can I convert a number to a string?
- Is it possible to execute code even after the program exits the main() function?
- What is the stack?
- How do you print an address?
- Can a file other than a .h file be included with #include?
- What is Preprocessor?
- How can you restore a redirected standard stream?
- What is the heap?
- How do you use a pointer to a function?
- What is the purpose of realloc( )?
- What is the purpose of main( ) function?
- Why n++ executes faster than n+1?
- What will the preprocessor do for a program?
- What is the benefit of using const for declaring constants?
- What is the easiest sorting method to use?
- How many levels of pointers can you have?
- Is it better to use a macro or a function?
- What are the standard predefined macros?
- What is a const pointer?
- What is a pragma?
- What is #line used for?
- What is the difference between text and binary modes?
- How do you determine whether to use a stream function or a low-level function?
- What is static memory allocation and dynamic memory allocation?
- When should a far pointer be used?
- What is the difference between far and near?
- When would you use a pointer to a function?
- How are pointer variables initialized?
- How can you avoid including a header more than once?
- Difference between arrays and pointers?
- What are the advantages of the functions?
- Is NULL always defined as 0?
- What is the difference between NULL and NUL?
- Can the sizeof operator be used to tell the size of an array passed to a function?
- Is using exit() the same as using return?
- Can math operations be performed on a void pointer?
- Can the size of an array be declared at runtime?
- Can you add pointers together? Why would you?
- Are pointers integers?
- What is a method?
- What is the easiest searching method to use?
- Is it better to use a pointer to navigate an array of values,or is it better to use a subscripted array name?
- What is indirection?
- How are portions of a program disabled in demo versions?
- What is modular programming?
- How can you determine the maximum value that a numeric variable can hold?
- How can you determine the maximum value that a numeric variable can hold?
- How can you determine the maximum value that a numeric variable can hold?
- How many levels deep can include files be nested?
- What is the difference between declaring a variable and defining a variable?
- How can I make sure that my program is the only one accessing a file?
- How can I sort a linked list?
- Is it better to use malloc() or calloc()?
- What does it mean when a pointer is used in an if statement?
- Array is an lvalue or not?
- What is an lvalue?
- Diffenentiate between an internal static and external static variable?
- What is the difference between a string and an array?
- What is an argument ? differentiate between formal arguments and actual arguments?
- What are advantages and disadvantages of external storage class?
- What is a void pointer?
- How can type-insensitive macros be created?
- When should a type cast not be used?
- When is a switch statement better than multiple if statements?
- What is storage class and what are storage variable ?
- What is a static function?
- How can I sort things that are too large to bring into memory?
- What is a pointer variable?
- What is a pointer value and address?
- What is a modulus operator? What are the restrictions of a modulus operator?
- What is a macro, and how do you use it?
- Differentiate between a linker and linkage?
- What is a function and built-in function?
- What is the difference between goto and longjmp() and setjmp()?
- Is it acceptable to declare/define a variable in a C header?
- Why should I prototype a function?
- What is the quickest searching method to use?
- What are the advantages of auto variables?
- What are the characteristics of arrays in C?
- How do you print only part of a string?
- In C, what is the difference between a static variable and global variable?
- In C, why is the void pointer useful?
- C Questions only (1)
- C Questions only (2)
- C Questions only (5)
- C Questions only (6)
- C Questions only (7)
- C Questions only (8)
- C Questions only (9)
|