Solved

Writing a file using C

Posted on 2012-03-23
3
240 Views
Last Modified: 2012-08-13
Attached is a file I am using to write read from one file and write to another.  Below is what is printed on the screen with the printf statement that is in the while loop.  Using the fputc command can I expect the information is going to the output file.  If the number 176 is printed on the screen I need 176 to go to the output file and not an ASCII equivalent.
THANKS!

176 0 0 176 32 115 192 27 186 0 0 186 32 114 202 27 176 7 100 186 7 69 240 67 16 76 2 1 2 0 247 240 67 16 76 2 1 0 1 16 247 186 91 36 240 67 16 76 2 1 34 0 247 240 67 16 76 2 1 32 66 0 247 176 93 35 240 67 16 76 2 1 34 0 247 240 67 16 76 2 1 32 66 0 247 186 93 70 240 67 16 76 2 1 64 6 0 247 240 67 16 76 2 1 90 1 247 240 67 16 76 2 1 86 64 247 240 67 16 76 2 1 87 64 247 176 94 40 240 67 16 76 8 0 17 127 247 186 94 0 240 67 16 76 8 10 17 127 247 177 94 0 240 67 16 76 8 1 17 127 247 240 67 16 76 2 1 74 0 87 247 240 67 16 76 2 1 12 64 247 240 67 16 76 2 1 13 64 247 240 67 16 76 2 1 2 0 247 240 67 16 76 2 1 0 1 16 247 176 91 28 184 0 127 184 32 0 200 0 185 0 127 185 32 0 201 0 240 67 16 76 48 42 5 20 247 240 67 16 76 48 46 5 20 247 240 67 16 76 48 51 5 40 247 240 67 16 76 48 36 5 0 247 240 67 16 76 48 51 4 73 247 184 7 55 184 91 45 185 7 76 178 7 88 179 7 65 179 10 100 179 91 40 179 93 35 179 0 0 179 32 127 195 27 180 7 65 180 10 100 180 91 40 180 93 20 181 7 55 181 0 0 181 32 127 197 49 182 7 71 182 10 70 182 91 42 182 93 0 182 0 0 182 32 127 198 0 183 7 66 183 10 20 183 91 40 183 93 10 183 0 0 183 32 127 199 25 240 67 126 1 0 27 16 28 247 240 67 16 76 2 1 0 1 17 247 240 67 16 76 2 1 12 64 247 240 67 16 76 2 1 13 64 247 240 67 16 76 2 1 12 64 247 240 67 16 76 2 1 13 64 247 240 67 16 76 2 1 2 0 247 240 67 16 76 2 1 0 1 17 247 176 91 28 240 67 16 76 2 1 32 65 0 247 240 67 16 76 2 1 44 64 247 240 67 16 76 2 1 45 64 247 240 67 16 76 2 1 44 64 247 240 67 16 76 2 1 45 64 247 240 67 16 76 2 1 34 0 247 240 67 16 76 2 1 32 65 0 247 176 93 35
midiio.c
0
Comment
Question by:sargent240
  • 2
3 Comments
 
LVL 53

Accepted Solution

by:
Infinity08 earned 500 total points
ID: 37760101
If you want the output file to be exactly like what you get on standard output, why not use fprintf instead of fputc ?
0
 

Author Comment

by:sargent240
ID: 37760652
let me check it out.  Thanks for the response, I'll let you know.
0
 

Author Closing Comment

by:sargent240
ID: 37774946
That's a keeper, Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now