|
[11 Dec 2003|12:08am] |
*Smile* Hello.
I'm trying to make a little ticker to move numbers across the screen in C++. I would guess this would use a delay of some sort. But when I try to impliment delay(5); into a "for" loop, I get "error C2447; missing function header (old style formal list?)"
Is anyone able to tell me what that means, or does anyone know how I could otherwise acheive what I'm trying?
Thank you in advance, mel
|
|
| Makefiles and other simplifications |
[11 Dec 2003|01:56am] |
| [ |
mood |
| |
cold |
] |
Makefiles: what is one, how do I use it, and is there a way to use them in order to combine compiler commands into a one-lined compilation command?
|
|
| Question on ctype |
[11 Dec 2003|04:10pm] |
| [ |
mood |
| |
anxious |
] |
I'm writing some code that can identify whether the word entered is digit, alpha or not. I think I need to use isdigit and isalpha to do it, but I'm not sure about which group some characters belong to.
For example, I need to fix those words: s?ail rab%it
Please tell me how to identify "?, %, #". Are they alpha?
Thank you very much.
|
|
| Template classes across multiple source files. |
[11 Dec 2003|08:13pm] |
Okay, this is a rather clueless question, but please bear with me.
I generally make much use of header files. Generally, I'll have one source file, and it will include several header files that define all the classes I've made for the project, including all their data members and member functions.
Recently, someone convinced me that this is bad practice. He said that I should define my member functions - and any other functions, for that matter - in a separate file. Specifically, that I should define them in a source file, rather than a header file. (His reasoning was that if I included my header file in multiple source files, and my functions were defined in this header file, then a copy of my functions would get compiled into multiple object files, so when I built from the object files and tried to reference my functions, I would get a linker error to the tune of "multiply defined function" or whatnot.)
This is all well and good, but then when I have a class template, the .cpp that contains my function definitions isn't really compiled (since the compiler doesn't know what template classes will actually be used; recall that it's the compiler's job to take care of class templates, which it does by compiling a different version for each template class that is actually used). When I build from the object files, then, I get a linker error complaining that I never defined the particular version of the function that now needs to be used.
To put this less abstractly, I'll give some basic code demonstrating the problem. (This code actually uses a function template, rather than a class template, in the hopes of giving slightly simpler sample code.) ( Read more...Collapse )
Does anyone have any thoughts how to deal with this? I'm sure this is a problem others have encountered - after all, the STL is composed almost entirely of class templates (hence the 'T'); how have they dealt with it?
Thank you for any help. :-)
|
|