-
-
-
-
-
Why should I prototype a function?
A function prototype tells the compiler what kind of arguments a function is looking to receive and what kind of return value a function is going to give back. This approach helps the compiler ensure that calls to a function are made correctly and that no erroneous type conversions are taking place.
-
-
-
-
-
-
-
-
Output of these programs.
c
struct Foo
{
char *pName;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}
a. Your Name
b. compile error
c. Name
d. Runtime error
c
struct Foo
{
char *pName;
char *pAddress;
}; -
-
-
-
-
Integral data type
which one of the following is not an integral data type 1. Character 2. Boolean 3. Integer 4. Pointer type
-
Which one of the following is NOT a default promotion?
1) If either operand of an arithmetic operator is unsigned long, the other operand is promoted to unsigned long. 2) If either operand of an arithmetic operator is unsigned int, the other operand is promoted to unsigned int. 3) If either operand of an arithmetic operator is int, the other operand is promoted to int. 4) If either operand of an arithmetic operator is double, the other operand...
-
puts (wer):
1. prints the string 8 8 8
2. prints the null string
3. prints the string m, n, b
4. none of these
">The following program fragment int m=n=b=8; char wer[80]; sprintf(wer, "%d%d%d", m, n, b,); puts (wer): 1. prints the string 8 8 8 2. prints the null string 3. prints the string m, n, b 4. none of these
C Interview Questions
Ans