|
From: Exuss D. <dra...@ce...> - 2001-11-22 17:18:58
|
Hi!
Does anyone knows tutorial on the WEB, or could me explain, how to
use files in C++. In the books and tutorials information are only
about text files, something like:
ofstream myFile("file.txt");
myFile << "Some text";
But how to store/read structured data in files? In Turbo Pascal it
looks like:
{ Creating a record }
type human=record
name:string;
age:integer;
end;
var myFile:file of human; {file for storing records "human" type }
person:human;
person.name := "GreatName";
person.age := 100;
assign(myFile, 'peoples.hhh');
rewrite(myFile);
write(myFile, person);
{ and so on .. }
How to do the same in C++ ??
Thanks!
Exuss
--
Nemokama el.pašto dėžutė - http://webmail.delfi.lt/
|