learning c in mint
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
learning c in mint
i wish to learn c using mint...i had a cygwin installed on my windowa for this purpose,it created unix like environment....
wat do i need to have a cygwin like app...or since linux is based on unix i can use terminal directly?
wat do i need to have a cygwin like app...or since linux is based on unix i can use terminal directly?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: learning c in mint
No cygwin needed. For basic, "Hello world programs", just compile it and run...
Re: learning c in mint
wat abt text editor...?
m a newb u see...ihv gcc and lib installed,text editor i dont hv the idea....
the main terminal cant be used to write programs...am i correct?
m a newb u see...ihv gcc and lib installed,text editor i dont hv the idea....
the main terminal cant be used to write programs...am i correct?
Re: learning c in mint
Not really. You can use one of the terminal based text editors but don't.deepakrathore23 wrote:the main terminal cant be used to write programs...am i correct?
Just use an ordinary text editor like gedit and compile from the console to start with so you learn
the basics. Find yourself a basic c tutorial and it will surely mention this.
Happy hacking!
Re: learning c in mint
A short introduction to using the gcc compiler: http://cs.acadiau.ca/~jdiamond/comp2103 ... ing%20gcc:
For general information about programming in C there are lots of good books and resources (a start might be: http://www.cprogramming.com/). It still find I learned the most about basics of the language with The C Programming Language, and its exercises.
If you want to programming not general C code, that will run on Windows, Linux and others, but you want to specifically program for Linux, you can not beat The Linux Programming Interface book. No Starch have a lot of good Linux books Their Autotools book might be useful also.
For programming GUIs on GNOME, you want Glade. For programming games and such, use SDL. The better IDEs have GUI design built-in (such as Anjuta).
As dagon pointed out you can use just gedit to edit .c and .h files; it will do proper syntax highlighting if you give it those extensions. If you want you can use an IDE (perhaps advisable for large projects). Some IDEs: http://linuxmafia.com/faq/Devtools/ides.html. It will take some trial & error on your part to find one that does what you need. Most can be installed from the Software Manager directly, without need to go download it yourself or anything so archaic.
Do yourself a favor, and use a revision control system for your source code (or at the very least take a daily backup of your source code files), so that you can always rollback on changes you made if needed. CVS / Subversion / Git / Bazaar, again a lot of options. Just pick one; choice also depends on if you want to write just yourself, or help out on other projects / get others to help you. Git is used a lot for open source projects.
For general information about programming in C there are lots of good books and resources (a start might be: http://www.cprogramming.com/). It still find I learned the most about basics of the language with The C Programming Language, and its exercises.
If you want to programming not general C code, that will run on Windows, Linux and others, but you want to specifically program for Linux, you can not beat The Linux Programming Interface book. No Starch have a lot of good Linux books Their Autotools book might be useful also.
For programming GUIs on GNOME, you want Glade. For programming games and such, use SDL. The better IDEs have GUI design built-in (such as Anjuta).
As dagon pointed out you can use just gedit to edit .c and .h files; it will do proper syntax highlighting if you give it those extensions. If you want you can use an IDE (perhaps advisable for large projects). Some IDEs: http://linuxmafia.com/faq/Devtools/ides.html. It will take some trial & error on your part to find one that does what you need. Most can be installed from the Software Manager directly, without need to go download it yourself or anything so archaic.
Do yourself a favor, and use a revision control system for your source code (or at the very least take a daily backup of your source code files), so that you can always rollback on changes you made if needed. CVS / Subversion / Git / Bazaar, again a lot of options. Just pick one; choice also depends on if you want to write just yourself, or help out on other projects / get others to help you. Git is used a lot for open source projects.
Re: learning c in mint
Code::Blocks is a nice IDE (Integrated development Environment)
http://www.codeblocks.org/
--a tutorial on C..
It is also the C++ variety, although you can usually ignore that and code in plain C, rather than the object based C++
http://www.codeblocks.org/
- It is also cross-platform being based on the Wxwidgets library..
--a tutorial on C..
It is also the C++ variety, although you can usually ignore that and code in plain C, rather than the object based C++
Re: learning c in mint
Two books I've read recently recommended using VI for writing my bash scripts and programming. Am I missing something? I would have thought gedit like mentioned above would be a more user friendly alternative. Is there something special about VI that I should stick with it and learn to use it? Sorry about hijack but may also assist original poster
Re: learning c in mint
Personally I just found vi (vim, joe etc.) confusing. Use a modern editor/IDE.Moggertron wrote:Two books I've read recently recommended using VI for writing my bash scripts and programming. Am I missing something? I would have thought gedit like mentioned above would be a more user friendly alternative. Is there something special about VI that I should stick with it and learn to use it? Sorry about hijack but may also assist original poster
The way I see it. No. Maybe if you have to find your way around an older machine.Am I missing something?
When I first tried Linux some ten years ago there was no function to automatically mount a USB-flash drive automatically. You had to pop it in
there and then mount it from the comman line. when I asked people why it wouldn't do this automatically since it looked like a modern
grafical desktop, I just got the answer that this was the way it was done under Linux... Use whatever programs you find suitable for your
needs. I highly doubt that vi is going to be one of them...
Personally I use Geany for my, rather modest, programming needs and I highly recommend it.
Re: learning c in mint
Thanks Dagon. I wasn't sure if there was some amazing feature that I was missing out on by not using it. I didn't think so, but I've been wrong in the past.
Re: learning c in mint
For an editor I like BlueFish, but gedit will work. As your programs get bigger you will appreciate the feature set in BlueFish though. So just enter your basic program in the editor of your choice and then save it to some subdirectory like ~/Documents/MyCPrg" then start a Bash prompt and do a cd to that directory and just issue a command similar to "gcc -o myprg myprg.c".
If there are no compile errors you can then run it with a "./myprg"
If there are no compile errors you can then run it with a "./myprg"
Re: learning c in mint
I've added my Script folder that is inside my Home folder to the path searched for programs. So I can skip the ./ part of the command.thaimann wrote:For an editor I like BlueFish, but gedit will work. As your programs get bigger you will appreciate the feature set in BlueFish though. So just enter your basic program in the editor of your choice and then save it to some subdirectory like ~/Documents/MyCPrg" then start a Bash prompt and do a cd to that directory and just issue a command similar to "gcc -o myprg myprg.c".
If there are no compile errors you can then run it with a "./myprg"