Jump to content

Programming in c++


K33BZ

Recommended Posts

Was wondering if anyone can point me in the right direction? I have alot of tutorial sites booked marked on how to learn to program, but I dont no what tools I will need to start learning how to program. Wanted to learn c++, I run Linux (Ubuntu 8.10). Can anyone please help me out with this. Thanks.

edit: got it all now from the IRC, thanks

Link to comment
Share on other sites

gcc should already be installed on your computer. To start out, make a file in your text editor of choice and save it as "yourChoiceOfName.cpp".

Now go to the command line, go to the directory of the file you creates. Now type:

gcc yourChoiceOfName.cpp

then run the file that was created in that file with ./fileName

Hope that helps you get started.

Basically gcc is a compiler to convert your code into machine language. You need this for c/c++ development. If you are interested in using an IDE for development, there is an Eclipse IDE package that is used for C++ development, as well as other choices like Kdevelop. I personally like eclipse though

Link to comment
Share on other sites

Yea if the above doesn't work

create this file

#include <iostream>

using namespace std;

int main()
{
     cout << "Hello, World!" << endl;
     return 0;
}

save this using gedit (text editor) as helloworld.cpp

then instead of using the gcc command in linux terminal

use g++ -o hello helloworld.cpp

this will create an executable called hello if it works. You can run the executable the same as above "./hello"

If you are after an IDE like microsoft visual studio to make compilation simple as a click... then i would recommend an ide (integrated development environment), my personal favourite under linux is one called codeblocks

Think the site is

CodeBlocks

its simple and easy to use and unlike KDevelop IDE and Eclipse its not full of stuff that confuses beginners :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...