C Programming and Technical

output?
Q. How does a C program come to know about command line arguments?

A. When we execute our C program, operating system loads the program into memory. In case of DOS, it first loads 256 bytes into memory, called program segment prefix. This contains file tables,environment segment, and command line information. When we compile the C program
the compiler inserts additional code that parses the command, assigning it to the argv array, making the arguments easily accessible within our C program

Read Solution (Total 0)

C Other Question

Q. What is the difference between %d and %*d in c language?

A. %d give the original value of the variable and %*d give the address of the variable.
eg:-int a=10,b=20;
printf("%d%d",a,b);
printf("%*d%*d",a,b);
Result is 10 20 1775 1775 .Here 1775 is the starting address of the memory allocation for the integer.a and b having same address because of contagious memory allocation
Q. How are pointer variables initialized?

A. Pointer variable are initialized by one of the following two ways
- Static memory allocation
- Dynamic memory allocation