By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,742 Members | 1,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,742 IT Pros & Developers. It's quick & easy.

display results

P: 3
hello..i'm trying to display my result in text file..
how am i going to display from printf command to display at
text file?
this is the example of of line need to be display in text file =

printf("Source address ::: %s\n",inet_ntoa(from.sin_addr)

i want to display this result in text file..
Jan 28 '08 #1
Share this Question
Share on Google+
1 Reply


gpraghuram
Expert 100+
P: 1,275
hello..i'm trying to display my result in text file..
how am i going to display from printf command to display at
text file?
this is the example of of line need to be display in text file =

printf("Source address ::: %s\n",inet_ntoa(from.sin_addr)

i want to display this result in text file..

Are you trying to display content from a text file to the STDOUT?
If this is is your requirement then you should first open the text file and then read it line by line and then display the read string.

Or
If you want to display the content as it is then use system call with type command like this
Expand|Select|Wrap|Line Numbers
  1. system("type <your text file>"); //in case of windows
  2. system("cat <your text file>"); //in case of Unix
  3.  
Raghuram
Jan 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.