[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



From: "Sune" <sslug@sslug>

<snip>

> > > Faktisk ER linein en pointer, det er en pointer til et array af
> > > chars.
> >
> > Nej. Læs eventuelt comp.lang.c FAQ Section 6.
>
> Fra Visual C++ helpfile:
>
> Array Declarations
> An "array declaration" names the array and specifies the type of its
elements. It can also define
> the number of elements in the array. A variable with array type is
considered a pointer to the
> type of the array elements.
>

Nu er det jo et linux forum det her, men det lader vi ligge. I C er char a[]
en adresse i memory hvor det første
element i arrayet ligger. char *a, er adressen på en pointer til det første
element i arrayet. sizeof på *a vil altså
returnere størrelsen på poiteren og den er, som en tidlige pointerede
(undskyld men jeg har fået slettet dit indlæg),
næppe ens med størrelsen af arrayet.

Tag forsjov at kigge på http://www.eskimo.com/~scs/C-faq/top.html, det er om
ikke andet interessant læsning.

Mvh

Magnus

PS. Jeg er lidt rusten i C, så rettelser er velkomne.




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