ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, probably the best compiler out there is good old GCC. It is straight forward to use for Newbies or advanced users. At some point you probably want to check out Make which allows you to right scripts to build your code so you don't have to type longish compile command lines each time.
Code:
#include<stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}
Code:
j_shaw@jshaw ~ $ gcc -Wall -o test test.c
j_shaw@jshaw ~ $ ./test
Hello World
Personally? I use vim. Realistically you can use whatever you want so long as it doesn't put stupid smart quotes or any other psuedo characters in the file.
This is a bit different than Im used to so if I wanted some type of editor which could help show me mistakes or errors while editing (if possilbe) what would you recommend?
Actually I do see where it tells me the line the error is in, so I guess its not that bad.. .just might take some getting used to.
Code:
complete.c: In function 'valid':
complete.c:62: warning: suggest explicit braces to avoid ambiguous 'else'
complete.c:58: warning: unused variable 'negCount'
Also keep in mind you can run some commands (like make) from within VIM and it'll automatically take you to the first error reported. (emacs will do this as well)
As far as something that will automatically tell you what errors you have, some of the IDE's might do that but I'll let someone else comment on that as I don't use any of them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.