|
-
February 11th, 2009, 05:38 AM
#4
Re: Simple C++ OOP Question
 Originally Posted by amarjitamarNew
I am having a small problem with C++. I am very new to OOP with C++. The basic idea of this program was to sum all the Odd / even numbers between 1-100 depending on the users choice.
Code:
Thank you for testing your code with Comeau C/C++!
Tell others about http://www.comeaucomputing.com/tryitout !
Your Comeau C/C++ test results are as follows:
Comeau C/C++ 4.3.10.1 (Oct 6 2008 11:28:09) for ONLINE_EVALUATION_BETA2
Copyright 1988-2008 Comeau Computing. All rights reserved.
MODE:strict errors C++ C++0x_extensions
iostream.h, line 1: catastrophic error: #error directive:
<iostream.h> is not a Standard header, use <iostream> instead.
Note that when you change this header name, that identifiers such as
"cout" and "endl" will no longer work, as they are in namespace
"std", so use be "std::cout" and "std::endl" respectively. See
http://www.comeaucomputing.com/techtalk/#cnames for more details
#error <iostream.h> is not a Standard header, use <iostream> instead. Note that when you change this header name, that identifiers such as "cout" and "endl" will no longer work, as they are in namespace "std", so use be "std::cout" and "std::endl" respectively. See http://www.comeaucomputing.com/techtalk/#cnames for more details
^
1 catastrophic error detected in the compilation of "ComeauTest.c".
Compilation terminated.
In strict mode, with -tused, Compile failed
Get another compiler. The standard header is <iostream>, and main() returns int, not void. Wherever you're currently learning C++, stop. The code you have uses old, outdated, and wrong concepts with respect to standard C++ (as of 1998).
Find another source of learning, preferably a good, modern, C++ book.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|