[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] End of file? (Beginning of file??)



Hans Henrik Hansen skrev:
> 
> Jeg oplevede i øvrigt noget andet 'mystisk':
> Hvis jeg tilbagekopierede det program, jeg citerede i første mail, til min
> editor, kunne det ikke længere kompilere - selvom det 'så rigtigt ud':
> 
> Skønt der (korrekt) stod:
> ...
> void main( void )
>   {....

'main' returnerer altid en værdi af typen 'int'. Det er rigtigt at nogle 
kompilere tillader brug af 'void main(...)' for derefter selv at ændre det 
til 'int' og en 'return 0;' i slutningen af programmet. Dette frarådes på 
det kraftigste at bruge denne notation. 

'main' _*skal*_ altid returnerer en værdi af typen 'int', og kaldes med 0 
(nul), 2 eller 3 parametre

 
> sendte compileren (g++) en 'parse error' foran '{'!
> 
> Og der kom flere fejl, bla. noget med '0240' og med variabler der ikke var
> erklæret (de *var* korrekt erklærede!)

Det skyldes en forskæld i tegnsættet mellem editoren og mail-programmet. Det 
er i de fleste tilfælde 'return' og mellemrum der er problemer med !!!

(John =;-)
-- 
http://www.adilock.dk/~john/
http://www.adilock.dk


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