![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Aug 2005
Posts: 68
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Look into "Bignum" (or roll your own arithmetic, maybe using a class/struct). I've used 4-, 8-, and 16-bit processors. They worked.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
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.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OnlineTextEditor.Com! | Sane | Show Off Your Open Source Projects | 43 | Jun 16th, 2006 9:55 AM |
| add mutiple users to the smbpasswd file. | Pizentios | Bash / Shell Scripting | 3 | Oct 20th, 2005 1:48 PM |
| After execution - Error cannot locate /Skin File? | wchar | Visual Basic | 1 | Mar 5th, 2005 10:04 PM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 5:12 PM |
| Structure char field to a disk file | ehab_aziz2001 | C++ | 0 | Feb 10th, 2005 3:42 PM |