Open File to Char Array

I'm trying to make a database to help me locate vehicle service tickets faster.
My problem is that I'm trying to open a single file and save the contents into a char array (char DataVal[999999];).
The file would simply hold a single number per array value, which would translate to a location that would be accessed via (LocVar = DataVar[RONum]).
The code is confidential, so I can only post light details.
I don't see any problem or question.
I'm not sure how to do it...
I have very little experience with fstream stuff. I guess I was looking for examples of how others might do it.
I've found plenty of tutorials explaining how to save text with spaces all into one string variable, but nothing telling me how to save numbers to a char array.
Last edited on
Is this a homework question?

Why not use a database (Berkeley DB, SQLite, PostgreSQL, etc) to store this information?
Nothing to do with school, a small business project, and if I just use someone elses database, what do I learn? I wouldn't be coming here asking this question if I didn't want to learn how to do it myself.
Learning to use a database C++ API is a non-trivial exercise. There is quite a bit to learn there!
Topic archived. No new replies allowed.