Beginner Help

Hi guys. I just started to learn c++ yesterday. I use a mac computer. I have CodeBlocks and Xcode,but I have no clue what to do. I not exactly sure whate ach program does. Thanks for your help!
Go to File, New, Project, Console Project and then windows pop up you don't change anything until it comes to destenation changing and name and then finish.

First program for you:

1
2
3
4
5
6
7
8
#include <iostream>
using namespace std; //STD standard Library, every program must contain this.

int main()
{
  cout<<"Hello, i am C++ program";  //cout used to display text on screen. Text is marked in       quotes
cin.get(); //Expecting user to press enter.
}

javascript:editbox1.editSend()
; <-This is used to end code line.
if you are on a mac you should learn objective c rather then c++. its what osx was programmed with and you will use it more on that system especially when you start using librarys like cocoa to create windows and such. you can still learn c++ if you want, but if your developing mac games and stuff for mac you should use objective c. its the most obvious choice since thats what all the libraries are.
Last edited on
I'll just drop in here and flap around a bit.

acorn has... well. I'll call it half a point. ;)
Cocoa (Mac OS X's API) is meant to be used with Objective-C. If you want to directly use the native API, then probably that's a good choice. However, AFAIK Objective-C does not see much use outside of the Mac OS and iOS platforms, and you *can* create GUI (Graphical User Interface, a.k.a. (in some cases) windowed) programs with C++ on Mac OS that will not only work on OS X but could be compiled on *other systems* (Window$, some Linuxes, Solaris). I recommend a library called QT. Also, if you're interested in developing games, then not only are there some *very* good game development libraries in C++, but compiler C++ tends to be faster (Objective-C is slower, which is a tradeoff for making it more dynamic).

Now, I would like to correct one small thing by happykiller. Sorry. ;)
using namespace std; //STD standard Library, every program must contain this.
Actually, the using namescape std; thing is optional. What it does is save you from having to type std:: in front of anything that's in the standard library (in that code: std::cout, std::cin).

Happy programming!

-Albatross

These videos should help you get started with c++

http://www.youtube.com/watch?v=GMx_G05cqYI
Topic archived. No new replies allowed.