-
July 17th, 2009, 11:13 PM
#1
A program error plz help?
A program for repeating a sentence for 250 times
# include <iostream.h>
# include <string.h>
void main()
{ int x;
cout<<"Could you please say that again?";
for (x = 0; x < 250; x+1)
{
endl;
}
return;
}
-
July 17th, 2009, 11:26 PM
#2
Re: A program error plz help?
Originally Posted by jonahmano
A program for repeating a sentence for 250 times
Your program does not compile.
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
The correct header is <iostream>, and main() returns int, not void.
Regards,
Paul McKenzie
-
July 17th, 2009, 11:49 PM
#3
Re: A program error plz help?
So please send the correct programming steps so that I can practice
-
July 17th, 2009, 11:55 PM
#4
Re: A program error plz help?
Code:
#include <iostream>
int main()
{
int x;
for (x = 0; x < 250; x++)
{
std::cout<<"Could you please say that again?" << std::endl;
}
return 0;
}
Last edited by jnmacd; July 17th, 2009 at 11:56 PM.
Reason: code tags
-
July 18th, 2009, 12:01 AM
#5
Re: A program error plz help?
what is
x++
std::cout
return 0;
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
|