Type: Posts; User:
I agree, the question doesn't make much sense. Sounds to me like you may want a map.
Making the constructor private will prevent you from creating an instance of that object, which is what you said you wanted to do. Pure virtual functions are the normal way to go about it.
Making your base class constructor private should do it too.
You don't need an else. The if by itself is enough.
Doesn't look like any kind of question.
What's your C or C++ question? Seems like this belongs in the Algorithms forum.
Not really. I'm not trying to be a jerk, but you need to understand the process yourself in order to explain it to the computer. I'm sure you know how to do it, but you need to figure out all the...
No. Multiplying the whole number feet by a decimal number is why you're getting compiler warnings in the first place. Remember for this exercise you need to convert everything to inches first.
Okay, so what would be the steps involved in converting say 7'3" to meters and centimeters? Just in English, not code.
If you're going to be a programmer, you need to be able to figure these things out.
How would you convert feet and inches to inches?
How would you convert inches to millimeters?
Then you need to work exclusively with the smaller units. For example, if you're using feet and inches, do all your calculations with inches. If you end up with a result of 27.5" for example, you...
Calm down. You've posted that three times in five minutes. You'll likely get help, but it's not usually going to be instant.
stdafx.h should be the first #include in your .cpp files.
Why don't you watch them both run in the debugger and see what yours is doing compared to his.
You'd be amazed at the number of problems posted here that become immediately obvious when the code is formatted properly.
If you want help, insulting people with way more experience than you...
What does your class do that CStdioFile doesn't?
What does your code have to do with a for loop, and what does either your code or your advice have to do with the original problem, why are you checking the value of a char array by checking one char...
Is that the only line in your stack? If not, find the last line of YOUR code referenced. If it doesn't show any of your code, you'll need to step through the debugger to find where it's going wrong.
Not sure C++ compilers will see it that way.
What is this?
num = (rand()%8)+ 2;
Running the program in the debugger is the best debugging exercise.
Do you still have a question?
How did you determine it was running correctly, when clearly it wasn't? Stepping through the code in the debugger is really the only way to know for sure what your program is doing, and it would...
Click Here to Expand Forum to Full Width