mercredi 30 novembre 2016

How compile C++ namespace in g++ without using Object-oriented

I want compile this code with g++ without using Object-oriented

(my mean is that I do not use this std::cout)

method but doesn't compile and i getting error. how can i do that?

my code :

1.cpp :

#include <iostream>
#include "1.h"

using namespace std;

int main()
{   
 myfunc();
}

1.h :

#include <iostream>
using namespace std;
int myfunc()
{   
 cout << "test";
}

i use this for g++ compile :

g++ -o t2 1.cpp

and run t2 with

sudo ./t2

Aucun commentaire:

Enregistrer un commentaire