🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #9554

Re: Dynamische Array in C++

#9554
From: Philip Paeps
Date: Thu, 25 Apr 2002 20:52
98 lines
3591 bytes
Christof Laeremans <christof_laeremans@hotmail.com> wrote:
> Philip Paeps <philip@paeps.cx> wrote:

[...]

> > In ieder geval zijn constructies als #include <iostream.h> niet wenselijk,
> > gebruik gewoon <iostream> en consoorten.

[...]

> Hier komt de volledige code.
> Dat van #include <iostream.h>. Ik heb het eens geprobeerd in een oefeningen
> die we moesten maken maar dan via #include <iostream> en het werd volledig
> afgekeurd door de docent :(

Afvoeren die docent!  C-style programmeren in C++?  Walgelijk.

> Nu, ja de volledige code.

Hierbij een diff, met wat opmerkingen.

------------- DGString.h -------------

--- DGString.h.old      Thu Apr 25 22:42:08 2002
+++ DGString.h  Thu Apr 25 22:37:31 2002
@@ -1,7 +1,7 @@
 #ifndef __DGSTRING_H
 #define __DGSTRING_H
 
-#include <iostream.h>
+#include <iostream>
 
 using namespace std;

------------- DGString.h -------------

------------- DGString.cpp -------------

--- DGString.cpp.old    Thu Apr 25 22:41:55 2002
+++ DGString.cpp        Thu Apr 25 22:46:33 2002
@@ -1,8 +1,9 @@
-#include <iostream.h>
-#include <string.h>
-#include <ctype> 
+#include <iostream>
+#include <string>
 #include "DGString.h"
 
+using namespace std;
+
 LangeString::LangeString()
 {
     //Constructor
@@ -45,7 +46,7 @@
 
 char * LangeString::getLangeString()
 {
-    strcat(_LangeString,".");
+    strcat(_LangeString,".\n");
     return _LangeString;
     delete [] _LangeString;
 }

------------- DGString.cpp -------------

------------- last.cpp -------------

--- last.cpp.old        Thu Apr 25 22:42:19 2002
+++ last.cpp    Thu Apr 25 22:49:39 2002
@@ -1,4 +1,4 @@
-#include <iostream.h>
+#include <iostream>
 #include "DGString.h"
 
 using namespace std;
@@ -39,7 +39,7 @@
     cout<<endl;
 
 
-    cout<<"De lange string is: "<<Woord.getLangeString();
+    cout<<"De lange string is: "<<Woord.getLangeString() <<endl;
 
 }

------------- last.cpp -------------

Om ��n of andere reden wil er maar geen newline komen na de laatste output.
Ligt mogelijk aan mij.  Ik ben nogal afgemat vandaag :-o

Compileert perfect met -Wall en -pedantic in gcc.  What more could you want?

 - Philip

-- 
Philip Paeps                                                   philip@paeps.cx

  Pills to be taken in twos always come
  out of the bottle in threes.
Technical Details
Message-ID: <L0_x8.39956$Ze.6814@afrodite.telenet-ops.be>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!195.40.4.120.MISMATCH!easynet-quince!easynet.net!colt.net!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
References: <B8EE1A81.2010%christof_laeremans@hotmail.com> <voYx8.39651$Ze.6724@afrodite.telenet-ops.be> <B8EE218B.2016%christof_laeremans@hotmail.com>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII
X-Google-Thread: fcea4,d8a342a4bf67824a
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2002-04-25 13:53:26 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!195.40.4.120.MISMATCH!easynet-quince!easynet.net!colt.net!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
From: Philip Paeps <philip@paeps.cx>
Subject: Re: Dynamische Array in C++
Newsgroups: be.comp.programming
References: <B8EE1A81.2010%christof_laeremans@hotmail.com> <voYx8.39651$Ze.6724@afrodite.telenet-ops.be> <B8EE218B.2016%christof_laeremans@hotmail.com>
User-Agent: tin/1.5.12-20020422 ("Sugar") (UNIX) (FreeBSD/4.5-STABLE (i386))
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
Lines: 98
Message-ID: <L0_x8.39956$Ze.6814@afrodite.telenet-ops.be>
Date: Thu, 25 Apr 2002 20:52:59 GMT
NNTP-Posting-Host: 213.118.35.198
X-Complaints-To: abuse@telenet.be
X-Trace: afrodite.telenet-ops.be 1019767979 213.118.35.198 (Thu, 25 Apr 2002 22:52:59 MET DST)
NNTP-Posting-Date: Thu, 25 Apr 2002 22:52:59 MET DST
Organization: Telenet Internet