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++]Newb question~

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DamiPL
Grandmaster Cheater Supreme
Reputation: 3

Joined: 02 Jul 2006
Posts: 1195
Location: 11001110

PostPosted: Tue Feb 10, 2009 11:22 pm    Post subject: [C++]Newb question~ Reply with quote

ok so i wanted to learn C++ and got some cool vids(3d buzz tuts), im sure most of u seen em.
So my question is whats the diff in Microsoft Studio 2003 and 2008.
heres a ss:

The 1st one is 2003 one and on the vid it works.
on 2008 however it wont and its the same exact thing. Its like 2008 does not recognize the main function?
*i dont much about c++ so dont flame.

_________________
Back to top
View user's profile Send private message AIM Address
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Tue Feb 10, 2009 11:34 pm    Post subject: Reply with quote

"int main()"

EDIT: just watched some of their tut. Jesus fuck fucking Christ. Get a new tut. 25 minute video on Hello World? Such watered-down material is not conducive to learning. I suggest you check out the sticky and find another tut. http://www.cplusplus.com/doc/tutorial/ is generally recommended.

_________________
Back to top
View user's profile Send private message
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Tue Feb 10, 2009 11:58 pm    Post subject: Reply with quote

Code:
#include <iostream>
using namespace std; // *see comment at end

int main()
{

cout  << "Hello World" << endl;

return 0;

}


the "using namespace std; makes it so you dont have to out std:: in front of things like cout, cin, endl, etc. Also, have to declare the function type. Which is why you make it int main, because you chose "integer main" you are trying to get a value from your function, which is why you return 0.

Feel free to ask anymore questions, also, check out the site HalfPrime posted, it will teach you the basic syntax of c++ much better.

_________________


Last edited by manc on Sun Feb 15, 2009 12:47 am; edited 1 time in total
Back to top
View user's profile Send private message
DamiPL
Grandmaster Cheater Supreme
Reputation: 3

Joined: 02 Jul 2006
Posts: 1195
Location: 11001110

PostPosted: Wed Feb 11, 2009 12:44 am    Post subject: Reply with quote

thx for the explanation and HalfPrime for the site, it will help alot.
one more thing, how can i make it so it does not exit after 1 sec.
I will read more of the site tomorrow but just wanna know that.

_________________
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: Wed Feb 11, 2009 12:54 am    Post subject: Reply with quote

1. you used ( ) instead of { } in your main function.

2. you can essentially wait for input by doing:

std::cin.sync();
std::cin.ignore();

or you can run your program from the command line.

3. never use void main.
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