PDA

View Full Version : Forgive me for a newbie question. Im trying to learn C++.


10Zav01
January 24th, 2009, 08:15 PM
Okay, so i have a c++ book.
it talks about compilers. i understand the concept of what a compiler is. and i think Ubuntu comes with them already?

anyhow i wrote this with the text editor and saved it to my Desktop, naming it HELLO.cpp

#include <iostream>

int main ()
{
std::cout << "Hello World!\n";
return 0;
}


my main question is, how do i compile and run it? the book isn't so clear on the instructions.

do i need to download some packages off synaptic?

sorry I am a clueless n00b trying to correct my ignorance towards the programming world.

Murrquan
January 24th, 2009, 08:56 PM
Okay, so i have a c++ book.
my main question is, how do i compile and run it? the book isn't so clear on the instructions.

do i need to download some packages off synaptic?


As I understand it, yes! I've never tried to program in C on Ubuntu, and haven't actually programmed anything in years. But you'll want a separate program, that you can use to compile the code you just wrote into an executable binary.

Maybe try Eclipse? I'm pretty sure there'd be something more lightweight just to compile some C code, but I hear that a lot of programmers do all their development in Eclipse.

10Zav01
January 24th, 2009, 10:15 PM
ty, i found out what i needed to know from another thread. i had used the search function before i posted. so sorry if i wasted space.