display results

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aziziahmad
    New Member
    • Jan 2008
    • 3

    display results

    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..
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by aziziahmad
    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
    [code=c]
    system("type <your text file>"); //in case of windows
    system("cat <your text file>"); //in case of Unix
    [/code]

    Raghuram

    Comment

    Working...