![]() |
|
Tutorial Introduction to C Programming [Part 1: Setup and terms] - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: C, C++, & Obj-C (https://sinister.ly/Forum-C-C-Obj-C) +--- Thread: Tutorial Introduction to C Programming [Part 1: Setup and terms] (/Thread-Tutorial-Introduction-to-C-Programming-Part-1-Setup-and-terms) Pages:
1
2
|
Introduction to C Programming [Part 1: Setup and terms] - phyrrus9 - 01-12-2015 So you want to learn how to program. Well, I think C is a great place. It is low level, but at the same time easy to understand once you've gotten the hang of it. Just a forewarning, I won't go into extreme detail in this series, it is just to get you comfortable enough to learn the rest on your own. So, part 1. Let's get you all set up. For the purpose of this tutorial, you will need to be running a linux system. I recommend Debian, and I will assume you are using Debian (or a debian-based system like ubuntu, KNOPPIX, DSL, etc). Let's get started. This step MUST be followed EXACTLY. It will be redundant in most scenarios, but just in case. You need to satisfy the following requirements to continue:
Alright, now let's get a list of the things we need:
Pretty simple. Let's install those things now. Code: apt-get update
apt-get install nano gccAssuming it installed correctly, you can go ahead and run exit to get back to a normal terminal. Terms: Code: Terminal - a TTY or terminal emulator
Editor - GNU Nano (our text editor)
Compiler - gcc (C compiler, turns our code into binaries)How to use nano: from a command line, type Code: nano <filename goes here>Code: ^W - Find
^\ - Find/Replace
^O - Write file
^X - Exit (write if needed before exit)
^- - Go to lineAnd there you have it, you're ready to start programming. In the next part I will start to teach you C from the ground up (the hard way, be afraid) RE: Introduction to C Programming [Part 1: Setup and terms] - Adorapuff - 01-12-2015 Do people still type code into nano? I'd only use that for minor changes as opposed to building programs. I'd much rather build programs in sublime, and if tty is a requirement vim, with highlighting as you can also click around on the terminal instead of arrow keys. RE: Introduction to C Programming [Part 1: Setup and terms] - phyrrus9 - 01-12-2015 (01-12-2015, 09:50 PM)Adorapuff Wrote: Do people still type code into nano? I'd only use that for minor changes as opposed to building programs. I'd much rather build programs in sublime, and if tty is a requirement vim, with highlighting as you can also click around on the terminal instead of arrow keys. No mouse usage in a TTY. Yes though, I use nano for nearly everything. Don't want to explain all of the vi commands today. Sublime is good, but it requires you to have also installed X11, and I REALLY don't want to deal with that nonsense. RE: Introduction to C Programming [Part 1: Setup and terms] - blackhatcat - 01-12-2015 (01-12-2015, 10:03 PM)phyrrus9 Wrote: No mouse usage in a TTY. Yes though, I use nano for nearly everything. Don't want to explain all of the vi commands today. Sublime is good, but it requires you to have also installed X11, and I REALLY don't want to deal with that nonsense. So you only ever write code in a terminal only environment and since you don't want to deal with xorg you are currently browsing and posting on SL using a text-based browser such as Lynx? That's pretty badass man, can I have a picture of your beard? RE: Introduction to C Programming [Part 1: Setup and terms] - phyrrus9 - 01-13-2015 (01-12-2015, 11:13 PM)blackhatcat Wrote: So you only ever write code in a terminal only environment and since you don't want to deal with xorg you are currently browsing and posting on SL using a text-based browser such as Lynx? Spoiler:![]() I have X set up on my machines, but I dont see a point in teaching you how to use it. RE: Introduction to C Programming [Part 1: Setup and terms] - Arthur Curry - 01-13-2015 This thread is rather remedial and does not make sense as a standalone tutorial, especially in the C/C++ coding section as there is little mention of coding. It would make more sense to just open whatever the next tutorial is with a mention of opening/creating a file in the user's favorite text editor. Nano is far from ideal for most programming and we would hate for users to be taught bad habits. It would seem the only Relevance to C is: (01-12-2015, 09:47 PM)phyrrus9 Wrote: apt-get update Which again, would make sense either as a foreground to the tutorial or as a reply to someone who is confused about how to use apt-get. It does not make sense to pigeonhole a tutorial of C programming like this to one distro of one OS using one specific editor. You will alienate more people than you will attract with such stringency. RE: Introduction to C Programming [Part 1: Setup and terms] - phyrrus9 - 01-13-2015 (01-13-2015, 03:55 AM)Arthur Curry Wrote: This thread is rather remedial and does not make sense as a standalone tutorial, especially in the C/C++ coding section as there is little mention of coding. It would make more sense to just open whatever the next tutorial is with a mention of opening/creating a file in the user's favorite text editor. Nano is far from ideal for most programming and we would hate for users to be taught bad habits. It would seem the only Relevance to C is: Much better. You may suggest an edit to the original thread. But note it is a multi part tutorial. Can't expect beginners to be expected to use a magnetized needle and a steady hand. Don't see how using nano is a bad habbit, but that can be your opinion if you wish. RE: Introduction to C Programming [Part 1: Setup and terms] - coax - 01-13-2015 Writing my C code into the simple text editor that OSX gave me. I'm new to C and got only the basics off till now. Also I'm not that confident to all the "special" editors. I don't know why people say that other editors are better then some others. Cause of the full screen mode, the customization or other stuff? Would be great to know what u guys think about the common editors. Maybe my next program would be written with one of this special editors. I personally don't like IDE's that much cause I think their helping beginners too much. Later when ur good at a language u can use them for faster progress. Thats my opinion. Whats urs? Hope to read the next part of ur C tutorial cause I'm rly interested bout it even if u just, like u told us above, cover the basics. Im looking for good C tutorials and these threads could be very nice. /coax RE: Introduction to C Programming [Part 1: Setup and terms] - Eclipse - 01-21-2015 (01-12-2015, 09:50 PM)Adorapuff Wrote: Do people still type code into nano? I'd only use that for minor changes as opposed to building programs. I'd much rather build programs in sublime, and if tty is a requirement vim, with highlighting as you can also click around on the terminal instead of arrow keys. Meh, I don't know: I kinda like nano. RE: Introduction to C Programming [Part 1: Setup and terms] - Master - 01-21-2015 Are you planing any Java or Python tutorials in the future it will greatly assist my studies. Thanks |