[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



Sune <sslug@sslug> wrote on 17-Aug-01:

> Det er korrekt, men det var nu heller ikke det vi diskuterede ;)

Vi startede med at snakke om sizeof, som netop er et af de få steder,
hvor et array ikke kan bruges i stedet for en peger til første
element.

At et array kan bruges i stedet for en peger til første element gør
dog ikke et array til en peger.


> Det jeg siger er, at a er en pointer når: 
> char a[300];

Ja, det siger du; men det er forkert. Læs og forstå Section 6 af den
FAQ. Fx Q6.1: "The type pointer-to-type-T is not the same as
array-of-type-T." eller Q6.9: "[...] but an array is *not* a pointer
[...]".


> Som du kan se, så opfatter kompileren "hej" som en pointer til et array.

Rent faktisk opfatter den "hej" som en pointer til første element i et
array. Q6.13.

At et array kan bruges i stedet for en peger til første element gør
dog ikke et array til en peger.


Venlig hilsen,
Anders - Language Lawyer.


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