Solved

Writing a file using C

Posted on 2012-03-23
3
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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 …

719 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