On types. As in, "preferably on objects" (like what I had posted earlier).Originally Posted by mitakeet
On types. As in, "preferably on objects" (like what I had posted earlier).Originally Posted by mitakeet
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Depending on what the original poster _really_ wants, CHAR_BIT is not necessarily tho most portable code. He probably wants the last octet of the number, not whatever the system happens to call a byte.
*bangs head on deask*Originally Posted by Rashakil Fol
*moves keyboard*Originally Posted by Rashakil Fol
*resumes head banging*
Quzah.
Hope is the first step on the road to disappointment.
Original poster (She),
I think I actually figured out which way the numbers need to be written to the file. and I used char pointers to put it that way. The only problem is that the file needs to be read by another application and if the format is wrong it all goes to hell. and I found that it was not a matter of which order the bytes are written in for a given number, but that it looks for specific bytes and disregards the rest of the bytes in the number. I'm on a tight schedule, so I won't spend time right now trying to make the code super portable and efficient. My boss is going for completeness. I will however save this whole thread and if time is left at the end of the project I will deffinetly use it to improve the code. Unless I run into the above addressed problems before that time, then I'll have to do it.
I know it's a bad approach, but stipid corporate leaders need results. Plus I'm not very very proffecient in C++.
thanks a lot guys,
AS.
Last edited by earth_angel; 07-14-2005 at 06:28 AM.