OMG Dev-C++ really !!! ( note : REALLLY ) suck i tested EACH codes and they all point me to the same error !! ill try another compiler for sure ..
OMG Dev-C++ really !!! ( note : REALLLY ) suck i tested EACH codes and they all point me to the same error !! ill try another compiler for sure ..
It isn't Dev-C++ (mingw). It is the fact that you are using non standard functions. Just have the program look for input by using cin.
why does somepoepel use
std::cout <<
instead of
cout <<
whats the difference?
only use std::cout if you #include <iostream> without using namespace std;
(std specifies the namespace, no kidding!)
"There are three kinds of people in the world...
Those that can count and those that can't."
It seems to me ( a newbie ) that Dev-C++ automatically replaces any occurance of getch() with getchar(). Does anyone else think so? Cause I use dev and i get the same exact error that says implicit declaration of getchar(), and it points to the line with getch().
AOL: GrNxxDaY
IDE: Dev-C++ Beta 5 (v4.9.4.1)
Project: Eye of Sahjz (text-RPG)
If you think I may need help, please IM me.
I started with the same book about a month and a half, or two ago.. I didn't get any errors..Originally posted by TheDarKinG
would u recommend cause with learn C++ in 21 days i got errors everytime i test their examples ..
get a good compiler (BC++ 5.5 for one) and then read the book properly.. that's all i can suggest.
if you still get errors, then post the code and someone here may help.
I can recommend you some websites
http://www.cplusplus.com
http://www.cppreference.com
Plus if you are using C++.\
try these to pause
cin.get();
will work 100%
Thanks
Pratik
Use standard C++ whenever possible. I use cin >> personally.
Why all the possibilities? Well, for one thing, there are many compilers in use today that aren't namespace compliant. Forcing everyone to use a single variety of compiler would not be cool, although it would improve the learning curve for newbies as they wouldn't have to filter through all the possibilities. For another, at some point you may use more than one namespace or an alternate to the std namespace. Placing the std:: before each function call requires more typing, but it makes absolutely clear which namespace you are using for which function. Being as clear as possible as to what you are doing is very important in programming. That's one of the things makes it neat for me: to be a decent programmer you need to be aware of both the big picture and the details.Code://compilers not namespace compliant #include <iostream.h> int main() { cout << "hello world" << endl; char ch; cout << "to stop the program, press any key and then the enter key" << endl; cin >> ch; return 0; } //namespace compliant compilers //recommended syntax for absolute beginners, not for others #include <iostream> using namespace std; int main() { cout << "hello world" << endl; char ch; cin >> ch; return 0; } //namespace compliant compilers //one recommended syntax #include <iostream> using std::cout; using std::cin; int main() { cout << "hello world" << endl; char ch; cin >> ch; return 0; } //namespace compliant compilers //alternate recomended syntax #include <iostream> int main() { std::cout << "hello world" << endl; char ch; std::cin >> ch; return 0; }
In addition to knowing whether your compiler is namespace compliant you also need to know whether your book/tutorial is written for namespace compliant compilers or not. If your book is using namespace compliant syntax but your compiler doesn't comply, or visa versa, you will need to make some adjustments.
Ok thx to all of u