Well, ge sorry for asking this I guess I get post happy. BUt look at it this way. While this post is new and easily found newbies like me can see it and go dig through some manually before posting...
Type: Posts; User: thenrkst
Well, ge sorry for asking this I guess I get post happy. BUt look at it this way. While this post is new and easily found newbies like me can see it and go dig through some manually before posting...
Apparently my references are more out of date then i thought. I have a decent C book but no complete C++ materials and I really can't afford to run out and buy a book for 30-70 dollars right now. ...
Ok, that's what I thought about the structures.
As far a void main (void) ....i get that alll the time. The ONLY reason i post it like that is becuase im writing pieces of code and testing them...
First of all i figured out how to open the file correctly in binary and do the bit operations. My main focus is on the EOF problem. I have read that part of the faq before and it is refering to C...
I have been playing with structures for the first time, quite simple really. But I seem to have trouble when I set a custom bit size for the data elements and the try to read directly into using...
Sorry but i have a book that verifies an int 2 bytes or 16 bits giving it a range of 65535 and 0. 32 bits is enough bits to store a number up to just under 4.3 Trillion unsigned.
You people make this more complicated then it is. ifstream.eof() of course. So like while (!ifstream.eof()){ifstream.get(buffer, sizeof(buffer))}; ect.
Dont even bother worrying about structures. I cant even get a regular variable to input correctly until the end of the file. And what i am doing is trying to read from any file (not made by a c...
I have been playing with defining custom size data types in structures, like 2 or 4 bit and stuff.
But ignoring structures i have enev been having trouble getting data read from a file into...
I have been playing with defining custom size data types in structures, like 2 or 4 bit and stuff.
But ignoring structures i have enev been having trouble getting data read from a file into...
Now im just a newbie but i dont see the problem since a space is a char just like any other, it doesnt count as a null or anything. So if you type the whole string at once and enter, the if i...
Lets see....
3 bits, 000, 001, 010, 100, 011, 110, 101, 111...
yep 8 ...=)
#include<iostream.h>
#include<fstream.h>
#include<string.h>
void main (void)
{
char buffer;
char file[256]= "C:\windows\desktop\cpptest.txt";
I am NOT passing a refferance to the infile.get(buff) sorry.
Ok, I am just writing this simple program that reads a text file char by char but when i use the buffer variable thats a single type char, and i then ask in an if statement in the buffer variable...
I have sam C in 21 days and i thought it was an excellent in depth but not to difficult refferance...dunno about Bible but if they call it the bible it would probably be a much deeper book.
Ok, I read all the post here and i found something i think is VERY usefull and was not mentioned.
By declaring a structure member to be a specific amout of bits,
e.g a char is 8 bit, and int is...
Ok, first sorry for the pathectic spelling of my posts. I usually post after 20 hours of being awake and i dont catch all that un-understandable slurs i leave.
Second, besides some () ( so i dont...
I still cant get a binary file to input all the way to the end byte by byte, Ive tried .read with char and int and long and tried .get, i dont know if its even inuting right thouhg because i cant do...
Sorry Dougdbug i never even looked at the base.cpp you sent me. I think ill figure it out once i play around with output a little bit. I just have to experiment to teach my self what i dont know. ...
Ok, i now get why it stops during the file using get, since get isnt really for anything but char/txt files. Um how might i use read then, to get byte by byte, read doesnt seem to work when i screw...
I fixed the binary number problem and added some () to fix possible precidence problems and it now compiles <the code at top of post> without any warnings at all.
BUt when i try to convert an exe...
Thanks Salem and DougDBug.....
That answers alot of my questions. I knew do a proggie like this wouldn't be to hard but since my only resources are to lame books and the internet not everything...
OK, im trying to write a c++ proggie to convert binary bits to ascii chars one that has been via proram back to a WORKING executable or whatever it was. I have found this formula from another...
Trust me what Im actually doing doesn't matter =)
I lied anyways.
When i want to reassemble the file it will already be in the EXACT format it was AFTER I used whetever methode to convert it...