[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] malloc ter sig underligt



Anders Melchiorsen skrev:
Peter Makholm skrev:

Garantien for at et int*-array er mere nul-afsluttet end et int-array
er da vist til at overskue. Så vi skal i begge tilfælde vide noget om
hvad funktionen returnerer.

Ja, men »int*« kan tildeles en »ikke defineret-værdi« (NULL), mens det ikke er tilfældet for »int«.


int **pointer;
pointer = find_numbers;
while(pointer != NULL) {
   printf("%d\n",**pointer)
   pointer++;
}

Der mangler vist lige en stjerne foran "pointer" i while-linjen.

Nej.

Så afsluttes løkken aldrig (hvis den går i gang)?


Enten det, eller jeg er for træt til at sidde her.

Jeg tror det var Peter der var for træt. Der mangler ganske rigtigt en asterisk i "while(pointer != NULL)". Jeg er vist også lidt for træt, i første omgang troede jeg du mente der manglede en foran "pointer++;" (hvilket der ikke gør).


Godmorgen,

Jacob
--
»hvis ikke engang statens embedsmænd kan overskue et område
 med patenter - HVORDAN I HEDE HULE HELVEDE SKAL VI ANDRE SÅ
 KUNNE GØRE DET?«                              -- Erik Lange



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