Login Register


Tutorial Introduction to C Programming [Part 1: Setup and terms] filter_list
Author
Message
Introduction to C Programming [Part 1: Setup and terms] #1
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:
  1. Connect to the internet
  2. Open a TTY (CTL+ALT+F3 will get you one) or terminal emulator (I would use xterm if you have it)
  3. Root access (run sudo -s)

Alright, now let's get a list of the things we need:
  1. Text editor (we will use nano)
  2. C Compiler

Pretty simple. Let's install those things now.
Code:
apt-get update apt-get install nano gcc

Assuming 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>
It will open up the file, you can use the keyboard to navigate and edit. Here is a list of key combinations you should know:
Code:
^W - Find ^\ - Find/Replace ^O - Write file ^X - Exit (write if needed before exit) ^- - Go to line
Of course, ^ means control+



And 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)

Reply





Messages In This Thread
Introduction to C Programming [Part 1: Setup and terms] - by phyrrus9 - 01-12-2015, 09:47 PM



Users browsing this thread: