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 


[error] C++ functions o-o

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Fri Jan 30, 2009 12:21 am    Post subject: [error] C++ functions o-o Reply with quote

okay, so i have this code

Code:

#include "stdafx.h"

using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
lolk(11);
system("PAUSE");
}
int lolk(int kk) {
   return 1;
}



just some random crap.
so then i test it out and it gives me a
microsoft visual studio wrote:

Error 1 error C3861: 'lolk': identifier not found

;-; halp?

_________________
Back to top
View user's profile Send private message AIM Address
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Jan 30, 2009 12:22 am    Post subject: Reply with quote

it's defined after you try, and call it.
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Fri Jan 30, 2009 12:24 am    Post subject: Reply with quote

slovach wrote:
it's defined after you try, and call it.

...wut o-o

_________________
Back to top
View user's profile Send private message AIM Address
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Jan 30, 2009 12:29 am    Post subject: Reply with quote

#include "stdafx.h"

using namespace std;

int lolk(int kk) {
return 1;
}

int _tmain(int argc, _TCHAR* argv[])
{
lolk(11);
system("PAUSE");

return 0;
}
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Fri Jan 30, 2009 12:35 am    Post subject: Reply with quote

oh damn i'm retarded thanks man
_________________
Back to top
View user's profile Send private message AIM Address
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Fri Jan 30, 2009 1:19 am    Post subject: Reply with quote

or just show him how to declare a function instead

slovach wrote:


//edited
#include "stdafx.h"
using namespace std;

int lolk(int kk); // << this will declare the function so the compiler will check the whole file for the function not just above the function you want to use it in


int _tmain(int argc, _TCHAR* argv[])
{
lolk(11);
system("PAUSE");

return 0;
}

int lolk(int kk) {
return 1;
}

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Fri Jan 30, 2009 9:38 pm    Post subject: Reply with quote

ohhh thanks!
_________________
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
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