C Programming and Technical

What is the difference between an enumeration and a set
of pre-processor # defines?

Read Solution (Total 0)

C Other Question

How can we read/write Structures from/to data files? Point out the error if any in the following program (Turbo C).
#include
#include
void display(int num, ...);

int main()
{
display(4, 'A', 'a', 'b', 'c');
return 0;
}
void display(int num, ...)
{
char c; int j;
va_list ptr;
va_start(ptr, num);
for(j=1; j<=num; j++)
{
c = va_arg(ptr, char);
printf("%c", c);
}
}
Options
1) Error: unknown variable ptr
2) Error: Lvalue required for parameter
3) No error and print A a b c
4) No error and print 4 A a b c