-
-
-
-
What is a macro, and how do you use it?
A macro is a preprocessor directive that provides a mechanism for token replacement in your source code. Macros are created by using the #define statement. Here is an example of a macro: Macros can also utilize special operators such as the stringizing operator (#) and the concatenation operator (##).The stringizing operator can be used to convert macro parameters to quoted strings, as in the...
-
-
Can static variables be declared in a header file?
You can’t declare a static variable without defining it as well (this is because the storage class modifiers static and extern are mutually exclusive). A static variable can be defined in a header file, but this would cause each source file that included the header file to have its own private copy of the variable, which is probably not what was intended.
-
Pascal Triangle
What is the C program for Pascal Triangle 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 5 1
-
-
-
-
-
Is nesting of conditional operator( ? : ) possible? If no then why? If yes then write down the program to find the greatest of three number?
Yes, Nesting of conditional operator is possible .Write down the program yourself.
-
What is the procedure in memory after running the c program ?
I mean generally after execution of c program .c,.doc,.exe,.bak files are created,so how these files are allocated in the memory stack?
-
-
-
-
Main(){ char * strA; char * strB = I am OK; memcpy( strA, strB, 6);}
A) Compile errorB) I am OKC) Runtime error.D) I am OExplanation: I am OK is not within " "
-
-
-
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
The strcpy() function is designed to work exclusively with strings. It copies each byte of the source string to the destination string and stops when the terminating null character () has been moved. On the other hand, the memcpy() function is designed to work with any type of data. Because not all data ends with a null character, you must provide the memcpy() function with the number of bytes you...
C Interview Questions
Ans