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 


C++ Functions
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
lucid
Master Cheater
Reputation: 0

Joined: 23 Jan 2008
Posts: 424

PostPosted: Mon Oct 25, 2010 2:15 pm    Post subject: C++ Functions Reply with quote

I don't get them :\

Anyone have a good example of why -and/or- how they are useful?
Back to top
View user's profile Send private message
Cheat Engine User
Something epic
Ban
Reputation: 60

Joined: 22 Jun 2007
Posts: 2071

PostPosted: Mon Oct 25, 2010 2:21 pm    Post subject: Reply with quote

There are no c++ functions. Simple as that.
Back to top
View user's profile Send private message
Benji
Random spam moderator
Reputation: 3

Joined: 31 Dec 2007
Posts: 58
Location: The Netherlands

PostPosted: Mon Oct 25, 2010 2:25 pm    Post subject: Reply with quote

I don't know how to use functions in C++, but I do know function usage in general.
Code:

new function charJump {
(code of your game character jumping comes here)
}

if key.up = true {
function charJump;
}


A.K.A, you can use large blocks of code with just 1 simple command.

_________________
Back to top
View user's profile Send private message
shitposter
Newbie cheater
Reputation: 5

Joined: 12 Nov 2008
Posts: 13

PostPosted: Mon Oct 25, 2010 2:32 pm    Post subject: Reply with quote

I forgot all the C++ I knew.

I only know Lua now.
Back to top
View user's profile Send private message
lucid
Master Cheater
Reputation: 0

Joined: 23 Jan 2008
Posts: 424

PostPosted: Mon Oct 25, 2010 4:09 pm    Post subject: Reply with quote

Quote:
Functions that a programmer writes will generally require a prototype. Just like a blueprint, the prototype tells the compiler what the function will return, what the function will be called, as well as what arguments the function can be passed. When I say that the function returns a value, I mean that the function can be used in the same manner as a variable would be. For example, a variable can be set equal to a function that returns a value between zero and four.


Now explain this shite

My brain doesn't grasp what it cannot comprehend. So make it dumb.
Back to top
View user's profile Send private message
Monkeys
I post too much
Reputation: 29

Joined: 20 Jul 2006
Posts: 2411

PostPosted: Mon Oct 25, 2010 4:16 pm    Post subject: Reply with quote

Yes.
_________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Mon Oct 25, 2010 4:16 pm    Post subject: Reply with quote

prototype:

Code:
int fuckingDicks(int, float, double, char);



function:

Code:
int fuckingDicks(int x, float shit, double cock, char p) {
    return x+69;
}
Back to top
View user's profile Send private message MSN Messenger
Gavin
Moderator
Reputation: 114

Joined: 30 Apr 2007
Posts: 1069

PostPosted: Mon Oct 25, 2010 4:17 pm    Post subject: Reply with quote

What's on your mind Nathan?
Back to top
View user's profile Send private message
lucid
Master Cheater
Reputation: 0

Joined: 23 Jan 2008
Posts: 424

PostPosted: Mon Oct 25, 2010 4:19 pm    Post subject: Reply with quote

theflyingwop wrote:
prototype:

Code:
int fuckingDicks(int, float, double, char);



function:

Code:
int fuckingDicks(int x, float shit, double cock, char p) {
    return x+69;
}


Now why would I use this instead of a simpler code?
Back to top
View user's profile Send private message
Monkeys
I post too much
Reputation: 29

Joined: 20 Jul 2006
Posts: 2411

PostPosted: Mon Oct 25, 2010 4:21 pm    Post subject: Reply with quote

Shigan wrote:
theflyingwop wrote:
prototype:

Code:
int fuckingDicks(int, float, double, char);



function:

Code:
int fuckingDicks(int x, float shit, double cock, char p) {
    return x+69;
}


Now why would I use this instead of a simpler code?


Say you have to use a certain snippet of code a lot.
Like creating a certain entity.
You'll write that snippet as a function and just call that function instead.

Like so:

Code:
main_playthrough()
{
  CreateEntity("Darp");
  CreateEntity("Varp");
}

void CreateEntity( Char[] )
{
  // Create it here etc...
}

_________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Back to top
View user's profile Send private message
lucid
Master Cheater
Reputation: 0

Joined: 23 Jan 2008
Posts: 424

PostPosted: Mon Oct 25, 2010 4:25 pm    Post subject: Reply with quote

Ohhhh

I get it. So if you had some simple code that did one thing, instead of writing it over 9000 times, you just call the function over 9000 times.

It's laziness, right? ( Also efficiency. )
Back to top
View user's profile Send private message
Monkeys
I post too much
Reputation: 29

Joined: 20 Jul 2006
Posts: 2411

PostPosted: Mon Oct 25, 2010 4:26 pm    Post subject: Reply with quote

Shigan wrote:
Ohhhh

I get it. So if you had some simple code that did one thing, instead of writing it over 9000 times, you just call the function over 9000 times.

It's laziness, right? ( Also efficiency. )

The latter.

Instead of c&p'ing 200 lines of code each time you need the functionality, you simply call that one line prototyped function.

_________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Mon Oct 25, 2010 4:26 pm    Post subject: This post has 1 review(s) Reply with quote

Shigan wrote:
Ohhhh

I get it. So if you had some simple code that did one thing, instead of writing it over 9000 times, you just call the function over 9000 times.

It's laziness, right? ( Also efficiency. )


Go read a programming book
Back to top
View user's profile Send private message MSN Messenger
lucid
Master Cheater
Reputation: 0

Joined: 23 Jan 2008
Posts: 424

PostPosted: Mon Oct 25, 2010 4:27 pm    Post subject: Reply with quote

Thank god. That makes my life much, much easier. Thanks Monkeys.

@guy above me: I am, derpslime.
Back to top
View user's profile Send private message
shitposter
Newbie cheater
Reputation: 5

Joined: 12 Nov 2008
Posts: 13

PostPosted: Mon Oct 25, 2010 4:28 pm    Post subject: Reply with quote

Any decent documentation would have told you all of this, either you're not paying attention or the doc is shit.
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 1, 2  Next
Page 1 of 2

 
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