Hello Reid,
Thanks a lot. I suspected it was wrong but kept trying somehow :(
I think it is self sorted in binary file? Instead of using 16 digits to move the pointer, I now use the last four digits. The possibility is 0 -> 9999 so I just need 10000 empty records to store them. When I use...
Thanks Reid for the binary :D
I use VS 2008 Pro SP1. It is now showing in binary mode now.
I think the error (doesn't write) is actually because of the nature of create 1000 empty objects. When the method create file with 1000 empty slots and set them into a file, their location will be
//...
Hi Reid,
the file.clear(); is to reset end-of-file indicator.
I never heard of a binary editor before :(
I use notepad to open up the data.dat file after generated 1000 empty records... it shows garbage.
like this :
ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ...
Dear Reid,
Yeah, I think I did.
Here is the code in main
int main()
{
//createFile();
fstream file("data.dat",ios::in|ios::out|ios::binary);
if (!file)
{
cerr << "Can't open file";
exit(1);
}
int choice;
while ((choice = enterChoice()) != 4)
{
switch (choice)
{
case 1...
Hello,
I am working on a program about credit card that basically, generate 16 ramdom digits, a starting balance and write it to a file. The file works as an database and can be updated later.
Here is my credit card class
class CCard
{
// variables section
private:
//sixteen digits of a...
Hi, nice to hear that. Actually, here is the few things you may need to consider when purchasing an HP 50g.
+ You may need a external AC power supply for your HP 50g. You can get one for cheap at hpcalc.org
+ Download the latest ROM from HP website to upgrade the calc
+ Use rechargeable...