Pejman Moghadam / C-programming

C++ - Hello world

Public domain


// a small C++ program
#include <iostream>
int main()
{
        std::cout << "Hello, world!" << std::endl;
        return 0;
}

// specific using-declaration
#include <iostream>
using std::cout;
int main()
{
        cout << "Hello, world!" << std::endl;
        return 0;
}

// Compile: g++ -Wall -ohello hello.cxx
#include <iostream>
using namespace std;
int main()
{
        cout << "Hello World !!!\n";
        return 0;
}

BY: Pejman Moghadam
TAG: cpp, hello-world
DATE: 2011-09-16 22:59:52


Pejman Moghadam / C-programming [ TXT ]