|
From: Robson B. <rob...@su...> - 2003-02-17 23:51:06
|
Thanks for the input Astar, but in my instalation of Dev-cpp does not exist
the /bit directory. I use Dev-cpp 4.01. Should i downloads v5.0? Oh, my gcc
is 2.9.
It worked but not fully. It created the file but the size was 0kb. I would
like to store in a binary file the high scores of my game. This way would
prevent the player to change the score if the score file was just a txt
file.
class hiscore {
public:
int score;
int level;
int pickups;
char name[21];
}
----- Original Message -----
From: "Astar" <As...@tu...>
To: <dev...@li...>
Sent: Sunday, February 16, 2003 1:07 AM
Subject: Re: [Dev-C++] Binary
Hello Robson,
Saturday, February 15, 2003, 9:43:44 PM, you wrote:
RB> Well, i'm working with <fstream> routines and want to create a file to
save
RB> binary data but it's not working. An error occurs when trying to compile
the
RB> following line:
RB> ofstream fout("datafile.dat", ios_base::binary);
i overcome this eroor some hours ago :)
if you use gcc 3.2
write:
std::ofstrem( "data.txt", std::ios::binary );
don't include "ios_base.h" and other internal headers. include
<fstream>
and add to include's settings C:\Dev-Cpp\include\c++\mingw32\bits
or just copy all files form there to C:\Dev-Cpp2\include\c++\bits
but If You use any previous gcc/mingsw32 just write:
ofstrem( "data.txt", std::binary );
--
Astar mailto:
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|