[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] Re: [NOVICE] C++



Fanch <sslug@sslug> skrev:

> I windows ser det sådan ud:
> 
> void main(void)

> Den går ikke her. Men hvis jeg skriver:
> 
> int main(int argc, char **argv)

main() returnerer altid int; at din compiler i Windows accepterer void
er en udvidelse/afvigelse fra C++, og derfor en fejlkilde når
programmet forsøges overført til en anden compiler - som du har
observeret.


> I windows behøver man umiddelbart  ikke bruge den sidste "-o
> start", da det ser ud til at der bliver automatisk lavet en .EXE
> fil der henter sit navn i den oprindelige filnavn til programmet.

Imidlertid kan du have mange kildefiler (.cc moduler), og derfor kan
denne regel ikke generaliseres til større programmer. Hvis du ikke
angiver noget -o output ender dit program som filen a.out, og den kan
i øvrigt køres med "./a.out" (uden at kopiere den noget sted hen).


> Jeg har også undret mig over hvordan man finder ud af hvilken
> include-fil man skal nævne.

Det læser man i sin C++ bog.

-- 
Stor hilsen -- Anders


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 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] *