Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   File manipultion (http://www.programmingforums.org/showthread.php?t=11454)

Lesliect6 Oct 3rd, 2006 7:52 AM

File manipultion
 
Hello,

I am a newbie at C++ and you will probably answer this question in seconds, but I would really like your help because I haven't found an answer to this on the internet.
I would like to read specified bytes from a file and store these bytes in variables for further manipulation. The file I/O header does not contain such commands, but these manipulations are essential for the project I want to make. I would like to store 16 bytes in my variable. How is this possible? What is the command I can use?
Thank you,
Leslie

DaWei Oct 3rd, 2006 8:21 AM

Look into "Bignum" (or roll your own arithmetic, maybe using a class/struct). I've used 4-, 8-, and 16-bit processors. They worked.

Game_Ender Oct 10th, 2006 10:22 PM

If you just want to twiddle the bits (not do arithmetic on them) you can use iostream::read() to read in the number of bytes you want into a buffer and manipulate the contents of the buffer as needed.


All times are GMT -5. The time now is 1:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC