LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to start (https://www.linuxquestions.org/questions/programming-9/how-to-start-46414/)

TazLinux 02-20-2003 08:55 PM

How to start
 
How can I start programming?


I would like to start with C, C+ etc etc.


Is there a program I need to start?

GtkUser 02-20-2003 09:21 PM

Use g++ on the command line for Standard C++ and gcc on the command line for Standard C console applications. Most books you buy on C and C++ will focus on the console. When you want to later build GUI applications than you can use Widget libraries such as GTK+ or QT. Or you can even use Java Middleware on Linux < http://members.shaw.ca/trollking >.

moeminhtun 02-20-2003 09:24 PM

Learning C is easy.
Every programmer starts programming with this program.
The program is very simple. Just to print a line.

#include <stdio.h>

int main()
{
printf("Hello, world\n");
return 0;
}


Type it out in any text editor and save it as any file name with extension ".c" say, "first.c".
At the command prompt, type
gcc first.c -o first

This will compile your program and produce the executable file called "first".

Then type
./first

to run the program. You will see the output "Hello, world" printed in the terminal.

There are a lot of resources on the C programming. You just search
"Linux C Programming" in google and you will get tons of results. Just browse through and pick a longer and complete guide you feel confortable with it. If you want solid hard copy, just print it out chapter by chapter. I think you don't even need to buy a book to start C programming. So many resources and ebooks on the net.

TazLinux 02-21-2003 03:20 AM

It worked, so does this mean I wrote my first program in C?

acid_kewpie 02-21-2003 03:20 AM

no, it means you copied your first c program!

moeminhtun 02-21-2003 04:01 AM

Quote:

Originally posted by acid_kewpie
no, it means you copied your first c program!
[ Please encourage the newbies. ]


Yeah! You wrote your first C program!.

This is the starting point. Every C programs are base on this. You might want to browse through the net, find a tutorial and try to understand it. It's pretty easy.

TazLinux 02-21-2003 07:46 AM

thanks guys


All times are GMT -5. The time now is 06:55 PM.