well this is my first post, and anyway
i started programming in c++ a few months ago never got very far, and ive taken it up again
and im compiling one of my practice programs
and i get errors, btw im using g++ for my linux machine
Code:#include <iostream> #include <stdlib.h> #include <string> using namespace std; int main(int argc, char *argv[]) { int i; cin > i; if (i > 10) { cout << "The number is greater than 10" << endl; } else if (i == 10) { cout << "It is equal to 10" << endl; } else { cout << "It is less than 10" << endl; } return 0; }
and now the error
gateway C++ # g++ secondprog.cpp -o secondprog
secondprog.cpp: In function `int main(int, char**)':
secondprog.cpp:8: no match for `std::istream& > int&' operator
thanks, and now im gunna go read my c++ for dummies eheh![]()



LinkBack URL
About LinkBacks



