|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I'm using g++ in Redhat linux and I have code like this:
Code:
#include <iostream>
int main()
{
cout << "Hello World!";
return 0;
}
__________________
Hi >> Saint |
| Sponsored Links |
|
|
|
|||||
|
Quote:
Code:
#include <iostream>
int main()
{
std::cout << "Hello World!";
return 0;
}
Code:
#include <iostream>
using std::cout;
int main()
{
cout << "Hello World!";
return 0;
}
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
Whoops! I meant cout. When did linux start using Namespaces? I thought this was a microsoft thing. What is a namespace exactly, just another name for a class, right?
__________________
Hi >> Saint |
| Sponsored Links |
|
|
|
|||||
|
Namespaces are a way to collect code from multiple files under an umbrella. For example, the standard library is in namespace std::. The advantage is that you are unlikely to accidentally use both the same namespace AND same variable/class name. But without namespaces you could easily use a somewhat obscure variable name and have a definition collision.
Namespaces are NOT part of linux, they are part of C++.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Java:Tutorial - Tic-Tac-Toe | John | Java Tutorials | 25 | 02-27-2008 06:41 PM |
| Othello program!! 24 hours left! | siren | C and C++ | 1 | 06-14-2007 11:18 AM |
| Need help w/ word count program (ASAP) | siren | C and C++ | 1 | 04-23-2007 08:14 AM |
| Getting Row Count | Lop | Managed C++ | 2 | 01-10-2007 08:17 AM |
| How to Count number of button has been Click? | roger | Visual Basic Programming | 4 | 06-01-2006 02:49 PM |
| Xav | ........ | 1455.48 |
| MeTh0Dz|Reb0rn | ........ | 1089.45 |
| WingedPanther | ........ | 977.76 |
| marwex89 | ........ | 962.9 |
| John | ........ | 914.37 |
| morefood2001 | ........ | 911.18 |
| Brandon W | ........ | 823.79 |
| chili5 | ........ | 312.39 |
| Steve.L | ........ | 276.28 |
| dcs | ........ | 253.49 |
Goal: 100,000 Posts
Complete: 84%