Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


need some help with a code.
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
The Fish
Expert Cheater
Reputation: 3

Joined: 11 Aug 2008
Posts: 114
Location: Ohio bitch

PostPosted: Tue Feb 01, 2011 12:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Simon :v
Grandmaster Cheater
Reputation: 38

Joined: 11 Oct 2006
Posts: 708

PostPosted: Tue Feb 01, 2011 12:25 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
InternetIsSeriousBusiness
Grandmaster Cheater Supreme
Reputation: 8

Joined: 12 Jul 2010
Posts: 1269

PostPosted: Tue Feb 01, 2011 12:25 pm    Post subject: Reply with quote

Wow, you really shouldn't try C++, or any language at all.
_________________
FLAME FLAME FLAME!!!@@@
Back to top
View user's profile Send private message
The Fish
Expert Cheater
Reputation: 3

Joined: 11 Aug 2008
Posts: 114
Location: Ohio bitch

PostPosted: Tue Feb 01, 2011 12:43 pm    Post subject: Reply with quote

Again, it's a school thing.
I'm gonna try rewriting it.
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Tue Feb 01, 2011 12:43 pm    Post subject: Reply with quote

OH LOL I didn't notice the int

indeed, use void.
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Feb 01, 2011 12:45 pm    Post subject: Reply with quote

Don't use a fucking void. Return 0.
Back to top
View user's profile Send private message
InternetIsSeriousBusiness
Grandmaster Cheater Supreme
Reputation: 8

Joined: 12 Jul 2010
Posts: 1269

PostPosted: Tue Feb 01, 2011 12:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Tue Feb 01, 2011 12:47 pm    Post subject: Reply with quote

Slugsnack wrote:
Don't use a fucking void. Return 0.

does it improve the code in any way ?
Back to top
View user's profile Send private message MSN Messenger
Simon :v
Grandmaster Cheater
Reputation: 38

Joined: 11 Oct 2006
Posts: 708

PostPosted: Tue Feb 01, 2011 12:52 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Tue Feb 01, 2011 12:57 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Feb 01, 2011 1:00 pm    Post subject: This post has 1 review(s) Reply with quote

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
View user's profile Send private message
Simon :v
Grandmaster Cheater
Reputation: 38

Joined: 11 Oct 2006
Posts: 708

PostPosted: Tue Feb 01, 2011 1:02 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Tue Feb 01, 2011 1:02 pm    Post subject: Reply with quote

:O
thanks for the info.
*learned something new*
Back to top
View user's profile Send private message MSN Messenger
shitposter
Newbie cheater
Reputation: 5

Joined: 12 Nov 2008
Posts: 13

PostPosted: Tue Feb 01, 2011 1:43 pm    Post subject: Reply with quote

Fixed it for him.
Back to top
View user's profile Send private message
Lyfa
The Lonely Man
Reputation: 12

Joined: 02 Nov 2008
Posts: 744

PostPosted: Tue Feb 01, 2011 2:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites