Article View: be.comp.programming
Article #16056Re: enterteken in Linux
From: Andy Georges
Date: Thu, 29 Jun 2000 00:00
Date: Thu, 29 Jun 2000 00:00
35 lines
1354 bytes
1354 bytes
> Hoe definieer je het enterteken in C++ in Linux?
> Aangezien '\n' niet werkt, wat dien je dan wel te nemen?
en waarom zou '\n' niet werken?
bvb.
#include <iostream>
int main(int argc, char* argv) {
cout << "look mom, it works\n";
cout << "another newline";
cout << '\n';
return 0;
}
prick:/tmp$g++ tt.cpp
prick:/tmp$./a.out
look mom, it works
another newline
prick:/tmp$
het is natuurlijk beter om, als je de newline in een dergelijke context
gebruikt 'endl' te gebruiken:
cout << "goo goo goo" << endl;
dat zorgt ervoor dat die newline ook op winblows machines en maccen
treffelijk functioneert
mvg,
andy
Technical Details
Message-ID:
<395BC0FB.57045638@pandora.be>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3958C3D8.97158B6F@pandora.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,a4a2778b35b39b0c,start X-Google-Attributes: gidfcea4,public From: Andy Georges <andy.georges@pandora.be> Subject: Re: enterteken in Linux Date: 2000/06/29 Message-ID: <395BC0FB.57045638@pandora.be> X-Deja-AN: 640535718 Content-Transfer-Encoding: 7bit References: <3958C3D8.97158B6F@pandora.be> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: afrodite.telenet-ops.be 962309790 213.224.87.149 (Thu, 29 Jun 2000 22:16:30 MET DST) Organization: Pandora - Met vlotte tred op Internet MIME-Version: 1.0 NNTP-Posting-Date: Thu, 29 Jun 2000 22:16:30 MET DST Newsgroups: be.comp.programming