Answers:
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 eg: 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
Contact Kiran
#include<stdio.h> int main() { char name[10]="prachee"; fprintf( stdout, "Hello %s ", name );
getchar(); return 0; }
Posted by: prachee
Contact prachee
fprintf(fp,"%d",printf("Hello"));
THis prints Hello on screen
Posted by: Swamy
Contact Swamy
Yes every thing is possible in C #define fprintf printf main() { fprintf("
hello"); }
Posted by: rakeshIIT
Contact 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.
   
|