View previous topic :: View next topic |
Author |
Message |
The Fish Expert Cheater
Reputation: 3
Joined: 11 Aug 2008 Posts: 114 Location: Ohio bitch
|
Posted: Tue Feb 01, 2011 12:05 pm Post subject: |
|
|
gogodr wrote: | The Fish wrote: | gogodr wrote: | The Fish wrote: | gogodr wrote: | The Fish wrote: | Code: | //Hello World by James Fisher
#include<iostream>
using namespace std;
int main(void)
{
cout <<endl <<"Hello Awesome World" << endl << endl;
system{"PAUSE");
|
code's done, just need to know how to end it. |
} |
I put it in and it stays here.
Code: | //Hello World by James Fisher
#include<iostream>
using namespace std;
int main(void)
{
cout <<endl <<"Hello Awesome World" << endl << endl;
system{"PAUSE");
} |
|
yeah... whats wrong with that? |
EDIT:
won't let me start it. |
care to post the errors? |
It says build failed.
|
|
Back to top |
|
 |
Simon :v Grandmaster Cheater
Reputation: 38
Joined: 11 Oct 2006 Posts: 708
|
Posted: Tue Feb 01, 2011 12:25 pm Post subject: |
|
|
I don't know C++ but most languages are relatively similar.
Quote: |
/* The Fish's hello world shit
with more comments */
#include <iostream>
using namespace std;
int main () // Why the fuck do you want this to return? Void, man. Void.
{
cout << "Hello World! "; // prints Hello World!
cout << "I'm a C++ program"; // prints I'm a C++ program
return 0;
} |
|
|
Back to top |
|
 |
InternetIsSeriousBusiness Grandmaster Cheater Supreme
Reputation: 8
Joined: 12 Jul 2010 Posts: 1269
|
Posted: Tue Feb 01, 2011 12:25 pm Post subject: |
|
|
Wow, you really shouldn't try C++, or any language at all.
_________________
FLAME FLAME FLAME!!!@@@ |
|
Back to top |
|
 |
The Fish Expert Cheater
Reputation: 3
Joined: 11 Aug 2008 Posts: 114 Location: Ohio bitch
|
Posted: Tue Feb 01, 2011 12:43 pm Post subject: |
|
|
Again, it's a school thing.
I'm gonna try rewriting it.
|
|
Back to top |
|
 |
gogodr I post too much
Reputation: 125
Joined: 19 Dec 2006 Posts: 2041
|
Posted: Tue Feb 01, 2011 12:43 pm Post subject: |
|
|
OH LOL I didn't notice the int
indeed, use void.
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Tue Feb 01, 2011 12:45 pm Post subject: |
|
|
Don't use a fucking void. Return 0.
|
|
Back to top |
|
 |
InternetIsSeriousBusiness Grandmaster Cheater Supreme
Reputation: 8
Joined: 12 Jul 2010 Posts: 1269
|
Posted: Tue Feb 01, 2011 12:47 pm Post subject: |
|
|
Slugsnack wrote: | Don't use a fucking void. Return 0. |
Exactly, I don't know why he didn't use the code that I made earlier.
Here it is again:
Code: | /* The Fish's hello world shit
with more comments */
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World! "; // prints Hello World!
cout << "I'm a C++ program"; // prints I'm a C++ program
return 0;
} |
_________________
FLAME FLAME FLAME!!!@@@ |
|
Back to top |
|
 |
gogodr I post too much
Reputation: 125
Joined: 19 Dec 2006 Posts: 2041
|
Posted: Tue Feb 01, 2011 12:47 pm Post subject: |
|
|
Slugsnack wrote: | Don't use a fucking void. Return 0. |
does it improve the code in any way ?
|
|
Back to top |
|
 |
Simon :v Grandmaster Cheater
Reputation: 38
Joined: 11 Oct 2006 Posts: 708
|
Posted: Tue Feb 01, 2011 12:52 pm Post subject: |
|
|
gogodr wrote: | Slugsnack wrote: | Don't use a fucking void. Return 0. |
does it improve the code in any way ? |
Maybe in the future it might; as it stands the return value serves no purpose at all.
|
|
Back to top |
|
 |
gogodr I post too much
Reputation: 125
Joined: 19 Dec 2006 Posts: 2041
|
Posted: Tue Feb 01, 2011 12:57 pm Post subject: |
|
|
xYashii wrote: | gogodr wrote: | Slugsnack wrote: | Don't use a fucking void. Return 0. |
does it improve the code in any way ? |
Maybe in the future it might; as it stands the return value serves no purpose at all. |
the main program?
I understand if it affects performance or what not but... returning a value out of the main program...at least as far as I have done, you never ever use that return.
|
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Tue Feb 01, 2011 1:00 pm Post subject: |
|
|
The return value can be used to determine the success of a program. Standard return values differ for different systems and standards. Usually 0 for success and non-zero for unsuccessful.
http://en.wikipedia.org/wiki/Exit_status
Also a main returning int is part of the ANSI standard and using void will cause a crash on certain systems expecting a return (especially embedded systems).
|
|
Back to top |
|
 |
Simon :v Grandmaster Cheater
Reputation: 38
Joined: 11 Oct 2006 Posts: 708
|
Posted: Tue Feb 01, 2011 1:02 pm Post subject: |
|
|
Slugsnack wrote: | The return value can be used to determine the success of a program. Standard return values differ for different systems and standards. Usually 0 for success and non-zero for unsuccessful.
http://en.wikipedia.org/wiki/Exit_status
Also a main returning int is part of the ANSI standard and using void will cause a crash on certain systems expecting a return (especially embedded systems). |
Go with this guy; he knows C++.
I was only making an analytic based on other languages I know.
|
|
Back to top |
|
 |
gogodr I post too much
Reputation: 125
Joined: 19 Dec 2006 Posts: 2041
|
Posted: Tue Feb 01, 2011 1:02 pm Post subject: |
|
|
:O
thanks for the info.
*learned something new*
|
|
Back to top |
|
 |
shitposter Newbie cheater
Reputation: 5
Joined: 12 Nov 2008 Posts: 13
|
Posted: Tue Feb 01, 2011 1:43 pm Post subject: |
|
|
Fixed it for him.
|
|
Back to top |
|
 |
Lyfa The Lonely Man
Reputation: 12
Joined: 02 Nov 2008 Posts: 743
|
Posted: Tue Feb 01, 2011 2:55 pm Post subject: |
|
|
Slugsnack wrote: | The return value can be used to determine the success of a program. Standard return values differ for different systems and standards. Usually 0 for success and non-zero for unsuccessful.
http://en.wikipedia.org/wiki/Exit_status
Also a main returning int is part of the ANSI standard and using void will cause a crash on certain systems expecting a return (especially embedded systems). | I don't know about C++, but shouldn't it be:
0, false, null, '' (empty string) - For failure
1, true, 'something' - for success?
_________________
|
|
Back to top |
|
 |
|