[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] kdevelop3 nybegynderspørgsmål. [SOLVED]



On Sun, 17 Oct 2004, Michael Berhard Sørensen wrote:

> Jamen dog.
> 
> >Har du husket 'using namespace std;'?
> >  
> >
> Jeg satte den linie ind i starten af de cpp-filer jeg har i projektet, 
> og så virker det.
> 
> Men hvorfor virker det? Jeg spurgte min lærer på skolen tidligere på 
> ugen og han gav ikke noget brugbar svar.


Det åbner std namespacet. Hvis du skriver:

a.cpp:

#include <stream>
using namespace std;

kan du bruge alle std i a, men hvis du har en fil

b.cpp 
#include <stream>
så skal du gøre det igen. Det er jo uafhængige enheder der bliver oversat.

Iøvrigt kan man også bruge
using std::cout;
using std::cin;
using std::endl;
osv i stedet.

Mads


-- 
Mads Bondo Dydensborg.                               sslug@sslug
Unix is user-friendly; it's just a little particular about which users it is
friendly to.



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

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