N
neo88
Ok, here's the deal. I have a nice class definition and a whole bunch
of inline functions to go along with it in the same file. My question
is, do I need an implementation file for the class, even though I have
an inline for every single function? Or can I just use the class and
it's inlines as a header file for programs that actually use the class
and defined functions?
While I'm here I might as well ask this one too. Here is a function
that I have in the same class that I was talking about above:
inline int Startup(void) {
short quit;
std::cout << "Welcome to the Agent system Neo\n"; IO stuff
std::cout << "Do you wish to continue?(y/n)\n";
while (quit != 'y') && (quit != 'Y')
(quit != 'n') && (quit != 'N') {
if (std::cin << 'y') {
std::cout << "Please wait\n";
} else (std::cin << 'n') {
Close(); // calls Close() function
}
This won't compile. The gcc says that I can't use the
short quit;
because it hasn't been declared. I don't have to declare it private
right? I tried that and it didn't work, I got the same error. How is
the loop structure, am I doing something wrong here? I also get a
parse error before 'quit' in the while loop just before the bitwise
'and' operator.
Thanks in advance for any help, it is greatly appreciated.
neo88
of inline functions to go along with it in the same file. My question
is, do I need an implementation file for the class, even though I have
an inline for every single function? Or can I just use the class and
it's inlines as a header file for programs that actually use the class
and defined functions?
While I'm here I might as well ask this one too. Here is a function
that I have in the same class that I was talking about above:
inline int Startup(void) {
short quit;
std::cout << "Welcome to the Agent system Neo\n"; IO stuff
std::cout << "Do you wish to continue?(y/n)\n";
while (quit != 'y') && (quit != 'Y')
(quit != 'n') && (quit != 'N') {
if (std::cin << 'y') {
std::cout << "Please wait\n";
} else (std::cin << 'n') {
Close(); // calls Close() function
}
This won't compile. The gcc says that I can't use the
short quit;
because it hasn't been declared. I don't have to declare it private
right? I tried that and it didn't work, I got the same error. How is
the loop structure, am I doing something wrong here? I also get a
parse error before 'quit' in the while loop just before the bitwise
'and' operator.
Thanks in advance for any help, it is greatly appreciated.
neo88