Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

FILE AND BINARY FORMAT

Posted on 2003-11-24
5
Medium Priority
?
281 Views
Last Modified: 2010-04-17
Hi all,
   I need to write data into my file in binary format directly. Like, say i need to write "Hello" into my file and while writing , it should be in binary format. I can't use fopen mode as "wb+" as it  can just convert into to binary format  while writing it into the file. But, i want my "hello" string to be in binary format when i use fprintf for "hello".Can somebody help me with this.Is there any single step to get it done?  
0
Comment
Question by:motian
2 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 212 total points
ID: 9809180
Hi motian,

I think you are not yet clear about the concept of binary format ...
pls go through this link
http://www.webopedia.com/TERM/B/binary_file.html
http://www.webopedia.com/TERM/B/binary_format.html
http://www.learnthenet.com/english/glossary/binary.htm

Cheers!
Sunny:o)
0
 
LVL 1

Assisted Solution

by:gabbitaravi
gabbitaravi earned 208 total points
ID: 9815809
hi,
IF ur using CFile of MFC, The following mode allows u to create a binary file
InFile.Open(FilePath, CFile::modeRead | CFile::typeBinary);
U need to store each record in a structure and write the structure into a binary file.
with warm regards,
ravi kiran
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Introduction to Processes
Screencast - Getting to Know the Pipeline

824 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