[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



On Tue, 13 Jan 2004, Jakob Oestergaard wrote:

> Spørgsmål: hvorfor har du en link.additem() ?  Hvorfor ikke bruge en
> STL liste?

Jeg har tidligere spurgt her på listen om hvordan man "rigtigt" koder 
en hægtet liste, og nogen sagde STL var overkill, andre sagde at det 
ikke var.

Her er min gl. test-kode:
http://www.sslug.dk/~chlor/cpp/linked.cpp.txt

> Spørgsmål 2: hvorfor lave en liste af pointere til objekter istedet
> for blot en liste af objekter ?

Hmm, nok fordi jeg ikke lige vidste hvordan man gør det.

Måske jeg skulle købe en bog om C++ :-)

> Hvis du kort kan forklare hvad det er du skal, lover jeg at komme
> med et pænt og simpelt eksempel som ikke lækker ;)

Programmet har et antal mulige "terminaler", input/output enheder 
såsom skærm, joystick og mus. Disse angives på kommandolinien og 
tilføjes så til denne hægtede liste. Hvis så det fejler med fx 
joystick, så kunne jeg da vælge at reboote eller formatere harddisken, 
eller alternativt blot køre videre uden joystick. Her valgte jeg så 
det sidste.

Når der så sker en event fra en "terminal", kalder jeg blot
	cmd = link.getcommand();
Tilsvarende har jeg nogle skærm-update funktioner, som dog ikke er 
relateret til fx joystick, men det ved joystick jo selv.

/hans
-- 
Hamletsgade 4 - 201, DK-2200 København N, Phone: +45 3582 9079
Schou Industries ApS      http://schou.dk/    CVR: 26 13 44 39
--------------------------------------------------------------
If KNOPPIX can't do it, Linux can't do it.
					-- Binh Nguyen


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