Hi,
> hi everyone. i was wondering if any one new how to create a data structure
> file e.g. a data base file in C++.
I am not sure what exactly you mean. The general way to do it is: write
a function or better a method to load/save one structure. Then do it in
a cycle for each structure in the database. And define a function or
method to load/save the whole database. It will write/load the number of
structures in it (and perhaps some more info like the name of the
database), allocate the memory needed and read the structures in a
cycle.
If you think of reading a structure with just one call like cin >>
structure; then you need to define an overloaded >> operator for the
structure.
And if you mean accessing .DBF file then I don't how to do it, since I
don't know its format.
> i was also wondering if anyone nows how to create folders without using "
> system("md test"); ".
I think there are no functions for directory operations in the ANSI/ISO
standard, so the source code is platform dependent. Under Windows, use
the function CreateFile to open a dir and get a handle (sounds strange,
but it really is CreateFile), CreateDirectory or CreateDirectoryEx to
create a dir, RemoveDirectory to remove it, GetCurrentDirectory and
SetCurrentDirectory to get/set current dir.
Hope this helps
--
============================================================
Ing. Boleslav Vrany
Stanice techniku DDM hl. m. Prahy
Pod Juliskou 2a
Praha 6 - Dejvice
16000
Czech Republic
tel. (420 2) 243 10 240
|