All pastes #183599 Raw Edit

Miscellany

public text v1 · immutable
#183599 ·published 2006-09-27 01:08 UTC
rendered paste body
// in test.h
class test {
private:
   int x;
   int y;
public:
   test* run;
}

// in test.cpp
#include <iostream>
#include "test.h"

using namespace std;

int main()
{
   for ( int i = 0; i < 10; i++ ){
      run[ i ] = i;
      cout << run[ i ] << endl;
   }

   return 0;
}


// errors
-bash-3.00$ g++ -Wall -g -o test test.cpp
test.cpp:4: error: expected unqualified-id before "using"
test.cpp: In function `int main()':
test.cpp:9: error: `run' was not declared in this scope
test.cpp:10: error: `cout' was not declared in this scope
test.cpp:10: error: `endl' was not declared in this scope
test.cpp:10: warning: unused variable 'cout'
test.cpp:10: warning: unused variable 'endl'