Hi, i was trying to use the fstream library to create a programme that serves someworth like a data base i.e it stores some information that will be used in the shortest possible time but the problem is that it does not work for me does any one have an idea?
denguru4
0
Newbie Poster
Recommended Answers
Jump to PostPost code. We are not clarvoyant and I don't have my crystal ball with me.
Jump to PostHere's a guess
struct some_stuff { int x; int y; char name[255]; }; int main() { some_stuff data; ofstream out("filenam.dat", ios::binary); if( out.is_open() ) { out.write((char *)&data, sizeof(data)); out.close(); } }
All 6 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
denguru4
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
denguru4
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
denguru4
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.