[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] Bestemme længde af streng på compile-time



On Tue, 24 Sep 2002, Jonas Kongslund wrote:

> >   printf("sizeof *foo: %i\n", sizeof(foo));
> >   printf("foo er %s", foo);
> >   return 0;
> > }
> > 
> > ...
> > sizeof *foo: 12
> > foo er fluffer ged
> 
> Smukt. Tak for hjælpen.

Det var skam så lidt. Bemærk at det (åbenbart) er mere korrekt at skrive
sizeof foo
og at du får \0 med i optællingen (altså, "ab" er 3 tegn).

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
I disapprove of what you say, but I will defend to the death your right to
say it.
  - Beatrice Hall [pseudonym: S.G. Tallentyre], 1907 (many times wrongfully
    attributed to Voltaire)



 
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] *