![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Professional Programmer
|
c++ in linux
Could someone please give me a link to a good totorial on c++ under linux, and maybe on how to use the gcc? i'm using gcc 3.2.3.
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#2 |
|
Professional Programmer
|
C++ in linux is the same as in Windows
g++ filename.cpp |
|
|
|
|
|
#3 |
|
Professional Programmer
|
In c++ i only worked in Borlanc c++ 3.1 ... and it might be simple but right now I can't get the hello world program going.
And yes, g++ filename.cpp ... had crossed my mind. So, ... any links would be helpfull 10x ![]()
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
then it creates a fiole a.out and run
./a.out |
|
|
|
|
|
#5 |
|
Expert Programmer
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 556
Rep Power: 5
![]() |
Isn't most Linux programming done in C? I have a book at home called 'Linux Programming by Example' and everything is in C
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4 |
|
|
|
|
|
#6 |
|
Professional Programmer
|
Ok, when i try using "cout" it sais : `cout' undeclared (first use this function)
#include <stdio.h>
using namespace std;
int main(){
printf("Hello");
int c=2;
printf("%d",c+1);
printf("\n");
cout<<"World"<<endl;
}Again ... if u have any links with tutorial for c++
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#7 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
If you want to use cout, you have to #include <iostream> as well. I don't know why you're using a namespace that doesn't even exist in the header files you've included.
|
|
|
|
|
|
#8 |
|
Professional Programmer
|
neither do I! that's y i was insisting on a LINK .... but no matter .. thanks for the help u gave me .. I'll take it from here
![]()
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#9 |
|
Professional Programmer
|
http://www.google.com/search?hl=en&q...=Google+Search
if you insist. |
|
|
|
|
|
#10 |
|
Programmer
Join Date: Mar 2005
Location: Washington
Posts: 90
Rep Power: 4
![]() |
Vim is the choice
--------
Please correct me if there is any flaw in the steps. Forgive me if I did not understand your question correctly and did not answer your question right, I am pretty new to Linux. ------------------------------ I'm assuming you have C++/C compiler and Vim editor already installed on your system. In my opinion, Vim is one of the best editor for all purposes especially when I'm working with c++/c code. Basically you can compile and run most of your C++/C programs from the editor. First, learn how to use vim by typing -> "vimtutor" from your terminal. You might want to read every directions carefully in the vimtutor. After you get down the basics(or during its process), open Vim editor by typing -> "vim (yourfilename).cpp" from your terminal. [following process takes place in the Vim editor] If you want your C++/C code to be neatly indented, type -> ":set cindent", and then start coding. To compile the file, type -> ":make (filename)", if there is a bug, fix it. Okay, now you're done with compiling. To execute the program that you have written, type -> ":!~/(filename)". The program will be executed then. Last edited by pal; Mar 3rd, 2005 at 5:57 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|