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 


Trying to make a calculator but keep getting a error

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Haruhi Suzumiya.
Master Cheater
Reputation: 1

Joined: 05 Feb 2005
Posts: 463

PostPosted: Tue May 26, 2009 6:14 pm    Post subject: Trying to make a calculator but keep getting a error Reply with quote

6 C:\Documents and Settings\user\My Documents\calculator.cpp `end1' undeclared (first use this function) . I am a big noob so explain to me what the problem is.
Back to top
View user's profile Send private message
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Tue May 26, 2009 6:24 pm    Post subject: Reply with quote

It means that end1 is undeclared or undefined...in line 6.
So declare end1 before you try to use it in line 6.

example, int end1;
(if you want to use it to store numbers, that is)

_________________
Back to top
View user's profile Send private message
Scathe
I post too much
Reputation: 0

Joined: 02 Aug 2006
Posts: 3631
Location: Smoking a blunt

PostPosted: Tue May 26, 2009 6:26 pm    Post subject: Reply with quote

You didnt declare whatever end1 is.

Unless you mistook endl; as end1;

its an L, not a number.

endl is short for end-line, which tells the compiler you're starting a new line.

example:

Code:

cout<<"This is a line!"<<endl;
cout<<"This is another line!";


Will output:
This is a line!
This is another line!

However this:
Code:

cout<<"This is a line!";
cout<<"This is another line";


Will output:
"This is a line!This is another line"

Hope that helps...unless you really made a variable called end1, then you didnt declare it correctly, but im 90% sure you just read your book wrong.

Edit:
Incase i am wrong.

Correct variable declarations:

type variable name

int end1

And if you want to instantiate it, just set it = to something.

e.g:
int end1 = 0;

_________________

<Moose> they will call me beard penis
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Haruhi Suzumiya.
Master Cheater
Reputation: 1

Joined: 05 Feb 2005
Posts: 463

PostPosted: Tue May 26, 2009 6:40 pm    Post subject: Reply with quote

Scathe wrote:
You didnt declare whatever end1 is.

Unless you mistook endl; as end1;

its an L, not a number.

endl is short for end-line, which tells the compiler you're starting a new line.

example:

Code:

cout<<"This is a line!"<<endl;
cout<<"This is another line!";


Will output:
This is a line!
This is another line!

However this:
Code:

cout<<"This is a line!";
cout<<"This is another line";


Will output:
"This is a line!This is another line"

Hope that helps...unless you really made a variable called end1, then you didnt declare it correctly, but im 90% sure you just read your book wrong.

Edit:
Incase i am wrong.

Correct variable declarations:

type variable name

int end1

And if you want to instantiate it, just set it = to something.

e.g:
int end1 = 0;
There's the problem! I put a 1 instead of a l T_T. Thank you!
Back to top
View user's profile Send private message
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