kano ta prota mou bimata....boithiste me parakalo

V13 v13 at priest.com
Tue Apr 1 00:39:01 EEST 2003


On Monday 31 March 2003 18:46, Yannis Kotsinos wrote:
> On Monday 31 March 2003 16:57, V13 wrote:
> > > > Παρακάτω ένα βιαστικό πρόγραμμα που έγραψα κι εγώ και κάνει αυτή τη
> > > > δουλειά:
> > > >
> > > > 	perl -e 'print reverse <>'
> > >
> > > Hehehe.  Den jero poso kala paizei auto me multimegabyte arxeia, alla
> > > einai ontws entupwsiako to ti mporei na ginei se mia perl grammh.
> >
> > E.. afoy afisame ta apla scripts kai piasame oysiastika glosses
> > programatismoy na kai kati antistixo se C... An eksereseis to write sto
> > stdout to ypoloipo prepei na'nai isos o poio grygoros tropos poy mporei
> > na ylopoihthei xoris na agxonetai gia to an to arxeio einai megalo h
> > oxi...
> >
> > <<V13>>
>
> an kai @amato to sygkekrimeno programmataki kanei reverse kai toys
> xarakthres, enw emeis 8eloyme mono tis grammes :) Ara mallon prepei na
> elegxei gia newlines, na toys krata se kapoio index (ie. ena aplo int) kai
> meta na kaneis advance ton pointer gia na grapseis th grammh kai pali pisw
> kok. Sto mege8os toy kwdika nikane oi perlatzides...

Oops.. grapse lathos.. nomiza ithele oloys toys xaraktires.. H diorthomeni 
(attached) ekdosi den ithele kai poles alages. To index tha to xreiazosoyn an 
itheles na ksereis ola ta EOL alla stin periptosi mas ayto den einai 
aparaitito...

>
> ps: to
>
> 	p2 = p1+s.st_size-1;
>
> einai gia na apofygeis to EOF?

To EOF den einai kapoios yparktos xaraktiras. Einai apla mia endiksi otan 
doyleveis me arxeia. Otan xrisimopoieis mmap olo to arxeio (h to komati poy 
theleis) ginetai map se mia perioxi mnimis (san enas pinakas apo chars).

To parapano einai san na exeis:

#define koko	1024;
char	*p1,*p2;
p1=(char *)malloc(koko);
p2=p1+koko-1;

Me ton tropo ayto to p2 dixnei sto teleytaio byte toy p1... (an se mperdevei h 
syntaksi desto san p2=&(p1[koko-1]) ).

<<V13>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a.c
Type: text/x-csrc
Size: 500 bytes
Desc: not available
URL: <http://lists.hellug.gr/pipermail/linux-greek-users/attachments/20030401/647ed77c/attachment.c>


More information about the Linux-greek-users mailing list