English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Actually i need to store records on file.i make it as structure.i don't know how to read when i am searching by a structure value.plz help.thanks in advance

2007-01-18 02:47:01 · 3 answers · asked by pown raj 1 in Computers & Internet Programming & Design

3 answers

overload the fstream or simply read data from the file as the same order you write it into the file
e.g
struct Point3d
{
double X;
double Y;
double Z;
}

you write (X, Y, Z) to file to form a Point3d
so when you want to read a Point3d from file, you also read X, Y, Z by the same order or algorithm

2007-01-18 03:10:31 · answer #1 · answered by platobungee 2 · 0 0

determine structure variable say s
enter each value of the field say name from keyboard
such as
s.name

use file commands to store it.

And you may get free C lessons by email from me.

2007-01-18 03:03:21 · answer #2 · answered by iyiogrenci 6 · 0 0

yes ,we can read and write d structures on to a file.

refer
complete reference or
programing in c- by- balaguruswamy

2007-01-18 03:02:41 · answer #3 · answered by arjun 1 · 0 0

fedest.com, questions and answers