mercredi 27 janvier 2016

c++ - using std namespace and dependancies

While trying to familiarize myself with c++ and its concepts, I came across the

using namespace std

and

#include <iostream>

my simple code is as follows

#include "stdafx.h"
#include "ConsoleApplication5.h"
#include <iostream>     

int main()
{
    std::cout << "hi";
    return 0;
}

Using Visual Studio 2015 Community, which uses intellisense, shows

cout

uses the following

std::ostream std::cout

As a C# programmer, this confuses me slightly. Is this :

std::ostream

being a return type while

std::cout

being the method/parameter passed or is

std::ostream

a dependancy of

cout

Aucun commentaire:

Enregistrer un commentaire