Aug 14, 2012 at 7:34am UTC
You can use conio.h too if you want
Aug 14, 2012 at 8:15am UTC
Thank you Akshit !
I'm sorry, you have to use conio.h
here. I missed that there was a getch()
somewhere in the code. I advised against it because it isn't a C++ standard although it is supported by gcc and MSVC, to name a few.
Last edited on Aug 14, 2012 at 8:16am UTC
Aug 14, 2012 at 8:25am UTC
compiler might give warning to use _getch();
instead of getch();
Aug 14, 2012 at 9:50am UTC
As an aside, if you write your programs in standard, modern C++ you will be able to use any modern C++ compiler.
Aug 14, 2012 at 3:53pm UTC
_ main
must return int
_ The headers are
1 2
#include <cstring>
#include <iostream>
conio.h is not standard.
_ Now you have namespaces. So it is
std::cout (you may use
using
)
About style
_ There is a
bool
type.
By instance
1 2 3
bool String::operator ==(const String &i) const {
return strlen(str) == strlen(i.str);
}
_ ¿Why is
menu() a method?
_ ¿why bother so much with the user interface if you only want to write in the line below?
Last edited on Aug 14, 2012 at 5:26pm UTC