gcc pathing problem?

Morten W. J. morten at newtec.dk
Wed Jun 15 13:16:38 UTC 2005


So as Collin and Dennis pointed out - I'll just summarize - you should try to 
change 

> #include <iostream.h>
>
> int main()
> {
> // cout << "The size of an int is: \t\t"  <<  sizeof(int)  << "bytes\n";
>  cout << "The size of a short\t\t"   <<  sizeof(short) << "bytes\n";
>  cout << "The size of a long is: \t\t"  <<  sizeof(long)<<  "bytes\n>  "; 

to

#include <iostream>

int main() 
{
// std::cout << "The size of an int is: \t\t"  <<  sizeof(int)  << "bytes\n";
 std::cout << "The size of a short\t\t"   <<  sizeof(short) << "bytes\n";
 std::cout << "The size of a long is: \t\t"  <<  sizeof(long)<<  "bytes\n";

OR

#include <iostream>

using namespace std;

int main() 
{
// cout << "The size of an int is: \t\t"  <<  sizeof(int)  << "bytes\n";
 cout << "The size of a short\t\t"   <<  sizeof(short) << "bytes\n";
 cout << "The size of a long is: \t\t"  <<  sizeof(long)<<  "bytes\n";

depending on if you perfer to cludder your code or your namespace. You'll have 
to choose one.

I know you said that you didn't want to change the source, but you would have 
a better life if you did, as that is the way to write C++ programs these 
days.

-- 
Morten W. Jørgensen




More information about the ubuntu-users mailing list