<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-7">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Xaire paides elpizo na eiste oloi kala!<BR>Ksero
oti den oi 2 parakato erothsoules den tha eprepe na erxontai se auth thn lista
apla ksero oti edo arketoi apo esas exoun idea apo C kai sunepos mpas kai
mporeite na dosete kamia idea. Auto pou thelo na kano einai na blepo to megethos
tou arxeiou mou to opoio periexei domes. Me ton tropo pou brhka sto net pairno
to megethos tou arxeiou se bytes.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>1) o tupas pou egraspe ton kodika bazei os 2o
orisma sthn fseek (poso tha metakinhthei apo thn SEEK_END) to 0L ...exei
kaneis kamia idea giati den bazei to 0? Kai allou ton eida na arxikopoiei se
-1L... <BR>2) to megethos ths domhs mou tha eprepe na einai 53bye (3 pinakes *15
xarakthres o kathenas = 45 kai 4 bytes kathe akeraios (2*4=8)...45+8=53 alla to
programma mou gurna megethos 56!!. An afaireso tous 2 akeraious apo to
telos ths domhs tha paro apotelesma 45 (3pinakes *15). An pali afaireso ton 1
akeraio tha paro apotelesma 52 eno tha eprepe na paro 45+4=49).. Auto pou me
dokimes brhka einai oti an exo tous pinakes xarakthron kai toulaxiston 1 akeraio
meta xrhsimopoiei 1 byte (gia kathe pinaka pou exo) epipleon...kapos san na tous
diaxorizei..exei kaneis kamia idea giati ginete auto? </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>sas paratheto ton kodika...<BR>1000 euxaristo
<BR>btw an kapoios kserei kanena ellhniko h kalo kseno newsgroup gia c h
ellhniko forum gia c programming as mou pei plz..</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#include <stdio.h></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>struct
ptisi{<BR>
char ar_ptisis[15]; </FONT></DIV>
<DIV><FONT face=Arial
size=2>
char poli_anax[15]; </FONT></DIV>
<DIV><FONT face=Arial
size=2>
char poli_afix[15]; </FONT></DIV>
<DIV><FONT face=Arial
size=2>
int ar_thesewn; </FONT></DIV>
<DIV><FONT face=Arial
size=2>
int
kr_theseis; <BR> <BR>
}rec;
//record<BR>
</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>main(){<BR>
<BR> FILE *f;<BR> <BR> int
sizerec;<BR> long lengthf;<BR>
<BR> f=fopen("test.dat","w+"); <BR>
fwrite(&rec,sizeof(struct ptisi),1,f);<BR>
fclose(f);<BR> <BR> <BR>
f=fopen("test.dat",
"r");<BR>
<BR> if(f !=
NULL)<BR>
{<BR>
fseek(f, 0L,
SEEK_END);<BR>
lengthf =
ftell(f);<BR>
fclose(f);<BR>
}<BR>
<BR> printf("to
megethos tou arxeiou se bytes einai %d
\n\n",lengthf);<BR>
<BR> sizerec=sizeof(struct
ptisi);
<BR> printf("h domh einai %d
\n",sizerec);<BR>
<BR>
system("pause");<BR>
<BR>}<BR></FONT></DIV></BODY></HTML>