|
From: Christian W. <Chr...@vo...> - 2001-04-12 10:27:00
|
Hi there,
i am still learning c++, for educational purposes i want to write a =
litle
database.
I created a struckt:
------------------schnipp----------------
typedef struct
{
char nname[100]; //Variable nname mit 100 Zeichen l=E4nge...
char vname[100];
char strasse[100];
char tel[100];
} S_ADRESSE;
S_ADRESSE datensatz[1000];=20
----------------schnapp------------------
if i want to write this in a file with
------------------schnipp----------------
FILE *p_dateizeiger;
int i_i;
int i_c;
char c_c[1];
//Versuche Datei zu =F6ffnen, bei Fehler ausgabe=20
if ((p_dateizeiger =3D fopen("adressen.txt", "w")) =3D=3D NULL)
{
//Da bei Fehler fopen den Wert NULL liefert, den
Fehler ausgeben
=20
printf("\nEs ist ein fehler beim oeffnen der Datei
aufgetreten !\n\n");
=20
break;
}
else
{
for (i_i =3D 0; i_i <=3D i_ds; ++i_i)
{
=20
printf("\nSchreibe Datensatz: %i\n",i_ds);
=20
for (i_c =3D 0; i_c <=3D 99; ++i_c)
{
=20
c_c[0] =3D
datensatz[i_i].vname[i_c];
if (c_c !=3D "\n")=20
{
if (c_c !=3D " " || c_c !=3D
"") fputc(datensatz[i_i].vname[i_c], p_dateizeiger);
}
else
{
fputc('\n',
p_dateizeiger);
break;
};
=09
=09
};
};
----------------schnapp------------------
and open the file with notepad there are many spaces before the
caracters...
How you see, i tried to filter this without any success...
Who can help ?
best regards...
Christian Wallukat
Voxtron auf der CeBIT: Halle 17, Stand C56 - besuchen Sie uns!=20
Voxtron GmbH, Porschestr. 1-7, 59227 Ahlen=20
Tel.: +49 2382 98974-0 / Fax: +49 2382 98974-74
Internet: <http://www.voxtron.de/> / Mail: <mailto:su...@vo...>=20
|