[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] gets strengen



> > hvordan tjekker jeg længden af linien "linein", man kan jo ikke bruge
> > sizeof på dynamisk allokerede arrays?
> 
> Længden er da underordnet mht strcmp().. ? Forudsat du kender de kommandoer
> din GUI returnerer, skulle det være nogenlude lige til at lave et array af
> mulige kommandoer og sammenligne med.

Æhhh, faktisk er det delstrenge jeg vil søge efter.
En kommando kan nemlig være f.eks. "usermove e2e4" eller "feature done=1",
så jeg kan ikke umiddelbart sammenligne "usermove" med "usermove e2e4" ;)

Jeg kan se der må være omkring 64x64 + 16 + 100~=4000 mulige strenge der skal fortolkes, det vil
sløve programmet urimeligt meget hvis det hele skal checkes igennem hver gang, desuden bliver det
en bet at skulle lave sådan en tabel.
Jeg har brug for at splitte den op i "usermove" og "e2e4", 
men det ser ud til at strstr kan gøre det.

> Der er jo også strstr() eller strtok(), jeg kan nemt forestille mig at løse
> dit problem med begge funktioner...

Nemt og nemt, det er vist stadig noget biks ;)

For lige at vende tilbage til mit oprindelige spørgsmål, er det så umuligt at finde længden af et
dynamisk allokeret array?

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *