[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: [PROGRAMMERING] Split char i C/C++



Hej,

On Thu, 2004-07-29 at 13:07, Christian Brønnum-Hansen wrote:
> Jeg har en char der foreksempel kan være på 150 tegn.

Så må du vist mene et char-array.

> Hvordan måler jeg længden af en char og hvordan deler jeg den op?

Funktionen strlen() fra string.h kan fortælle dig længden af dit
char-array givet at det er nul-termineret. Se evt. 'man strlen'.

Nu nævner du ikke noget om hvilke kriterier der skal ligge til grund for
opdelingen af array'et, men se næste kommentar - der er nok noget du kan
bruge i string.h.

> Hvis der altså er en funktion til det.

For en oversigt over funktionerne i string.h og strings.h se 'man
string'.

> Ellers må jeg jo bare lave en løkke der putter hver eneste tegn ind i
> den rigtige char men det synes jeg er lidt voldsomt...

Voldsomt? Hvorfor?

Mvh
Brix
-- 
Henrik Brix Andersen <sslug@sslug>



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 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] *