C Programming and Technical

Q. what will be the position of the file marker?
a: fseek(ptr,0,SEEK_SET);
b: fseek(ptr,0,SEEK_CUR);

A. a: The SEEK_SET sets the file position marker to the starting of the file.
b: The SEEK_CUR sets the file position marker to the current position
of the file.

Read Solution (Total 0)

C Other Question

Q. Do you know pragma directives in c?

A. Pragma is implementation specific directive i.e each pragma directive has different implementation rule and use. If compiler does not recognize particular pragma it simply ignore that pragma statement without showing any error or warning message and execute the whole program assuming this pragma statement is not present.
Q. Predict the output or error

A. main()
{
main();
}

A. Runtime error : Stack overflow.

Explanation: main function calls itself again and again. Each time the function is called it's return address is stored in the call stack. Since there is no condition to terminate the function call, the call stack overflows at runtime. So it terminates the program and results in an erro