Use it as:
fprintf( stout, "Hello %s
", name );
this line prints Hello on the console.
to print "Hello" in a file, put the file pointer in the place of stdout
fprintf( fp, "Hello %s
", name );
however, the file should be opened in write mode since we are writing.
Posted by: Manik Sidana
Contact Manik Sidana
no u can't do it...it is used to write data into the file...
Posted by: priya ranjan pani
Contact priya ranjan pani
Yes. by duplicating the ostream file descriptor
Posted by: Kiran
fprintf( stdout, "Hello %s ", name );
Posted by: prachee
THis prints Hello on screen
Posted by: Swamy
Yes every thing is possible in C
#define fprintf printf
Posted by: rakeshIIT
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
There should not be any Spelling Mistakes.
There should not be any Gramatical Errors.
Answers must not contain any bad words.
Answers should not be the repeat of same answer, already approved.
Answer should be complete in itself.