I had finished reading about stdio.h
functions and need some small clarifications.
Please take a minute to give short explanations for the following:
1) tmpnam()
: It only gives us a string containing a unique file-name, but what to do about the file extensions?Will we have to use strcat()
each time to add the file extension to the file name?
2) rand()
: What does the following mean in the context of rand()
(Taken from cplusplusreference
)?:
"In C, the generation algorithm used by rand is guaranteed to only be advanced by calls to this function"
I checked it, repeatedly calling rand()
one after another for the same seed, but it doesn't give increasing values!
3) getc()
: What does the part in bold mean in the following description of the parameter of getc()
taken from the same site(getc())?
"---Parameter
Pointer to a FILE object that identifies an input stream.
Because some libraries may implement this function as a macro, and this may evaluate the stream expression more than once, this should be an expression without side effects."