otey
January 6th, 2006, 03:02 AM
Hi
I know PHP, but where does that leave me, when i want to write some of them cool textbaced linux programs. I want to learn some of the heavy stuff :p
I've been looking at some "c" but I don't know where to start. I found this tutorial though. http://www.physics.drexel.edu/courses/Comp_Phys/General/C_basics/c_tutorial.html
but i'm a little confused..
When i try to compile the first example with gcc, i get errors.
The example is:
#include < stdio.h>
void main()
{
printf("\nHello World\n");
}
The errors are:
otey@osys:~/otey_development/c$ gcc hello.c
hello.c:1:20: error: stdio.h: No such file or directory
hello.c: In function 'main':
hello.c:5: warning: incompatible implicit declaration of built-in function 'printf'
hello.c:4: warning: return type of 'main' is not 'int'
If i replace #include < stdio.h> with #include <stdio.h> i get some of the same errors, but the code is compiled to an a.out file.
Should i
a) Proceed with the tutorial, and just remove the whitespace in every #include thingee
b) Get a new tutorial somewhere
c) Correct something on my system
d) Forget about the stupid idea about programming, and go back to bed
Hope to get answers
I know PHP, but where does that leave me, when i want to write some of them cool textbaced linux programs. I want to learn some of the heavy stuff :p
I've been looking at some "c" but I don't know where to start. I found this tutorial though. http://www.physics.drexel.edu/courses/Comp_Phys/General/C_basics/c_tutorial.html
but i'm a little confused..
When i try to compile the first example with gcc, i get errors.
The example is:
#include < stdio.h>
void main()
{
printf("\nHello World\n");
}
The errors are:
otey@osys:~/otey_development/c$ gcc hello.c
hello.c:1:20: error: stdio.h: No such file or directory
hello.c: In function 'main':
hello.c:5: warning: incompatible implicit declaration of built-in function 'printf'
hello.c:4: warning: return type of 'main' is not 'int'
If i replace #include < stdio.h> with #include <stdio.h> i get some of the same errors, but the code is compiled to an a.out file.
Should i
a) Proceed with the tutorial, and just remove the whitespace in every #include thingee
b) Get a new tutorial somewhere
c) Correct something on my system
d) Forget about the stupid idea about programming, and go back to bed
Hope to get answers