[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] [C++] new class, fail. Ønskes: NULL pointer



Hej Nils

Nils Ljunggren wrote:
Vi snakker C++
foo = new bar();
burde selvfølgelig hede foo= new bar;
constructor() er i C++ en funktion der returner en kopi af en default
constructor -- dette bør give problemer!

Hvilke problemer er det ?


Kan man ikke have en konstruktor, der tager argumenter ?

CMyClass *foo = new CMyClass(a,b);

Hvis, ja, er det så ikke det samme som

CMyClass *foo = new CMyClass();

på nær argumenterne ?

Jeg bruger egentlig altid

foo = new bar;

på grund af vane, så jeg har ikke tænkt så meget over det.

--PMM



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

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