View Single Post
Old 10-22-2004, 06:03 PM   #5 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
- conio
That is not standard whatsoever.

- iostream.h / math.h
He is using "cin", "cout" and uses "double" as default precision variables. Note that the standard (C++) assumes "double" as the default precision type. All of this gives me the impression that he want's to use C++ instead of C.
In that case, the above headers do not exist in standard C++. Old.

Quote:
code:--------------------------------------------------------------------------------
//Optional functions: depends on IDE.
void wait_for_enter();
--------------------------------------------------------------------------------


not optional, it is required by c and c++ to provide a function declaration before using that function...
The comment never said that the declaration is optional in case it is being used. It said that the function is optional.
Quote:
code:--------------------------------------------------------------------------------
int main(int argc, char *argv[])
--------------------------------------------------------------------------------


his main declaration was correct, why fix it?.
I didn't fix it. I had/have a script running for my own needs on startup.

I hope this cleared up a few things. Your comments are good topics to discuss. However, note that I only support ISO C++ (I use structs as intermediate types as an exception). I stay away from "C" or anything else, as you most likely noticed. I think it is important to teach students to code according the standards. Not because the standards are sacred to me, but because it makes people think more about what they are doing (with their language), from scratch.

Besides, this is the standard C/C++ forum. Let's use it that way.
__________________
Valmont is offline   Reply With Quote