We need to talk about the tools you'll need to learn C programming, and the basic tools you'll need whatever your operating system is, is a compiler, a C compiler and editor. A simpler editor is better, an editor that's a plain text editor. You can of course use something like Microsoft Word provided that you store things in plain text. Microsoft Word is an intelligent editor, it has all funky characters. A C compiler doesn't expect that, and so that would confuse it a lot. So if you're going to work on something like Windows, you can use typically a compiler like Notepad. What are the tools? A tool for example that's a C compiler, that's freely available, and generally can be installed on most any computer system, is the GNU Compiler. A GNU Compiler has it's command GCC, or of course, the other majors system you're likely to be on is Windows System. There you can get very good tools directly from Microsoft, and they're probably the best tool would be a form of Visual Studios. Now, what I'm not going to do in this class is go into detail about different compilers, little nuances for the compiler, how to install the compiler. All of these things are required. In many cases, the install procedure is no more complicated than getting a package, and just following the instructions that typically will install what you need. But if that's not your level of expertise and you're uncomfortable with that, you should get some help. So the presumption here is you have a C compiler and you have an editor. Again, I'm going to use the universal editor it's freely available. It's sometimes called VI or VIM. As I said an alternate editor for a Windows system might be Notepad. What you'll see throughout this course, is my home computer which is a Mac, and I'll be using the Mac with its Terminal Window. Why the Terminal Window? Because that's a very simple programming environment. It's very [inaudible]. It's basically the Unix operating system. So some of you may even have a Unix operating system either through your university, or sitting on whatever box you have. There are Unix operating systems that can sit under Windows as well as the already installed one for a Macintosh. What we will use is VI, and VI will be used to write code or data files, and the instructions that we need to use there are fairly simple. But again, that's not the point of the course. So you should get comfortable with how you use a basic simple text editor. Again, in this Window, we will use the GNU Compiler and the GNU command GCC to compile our code. When you get an idea to write code for a particular problem, or something you're interested, or some test, I always say write the code first on paper. Paper and pencil maybe that I'm just old school. Lets you think about it and even what we call hands simulated. So not only do you write it, make sure visually it looks like what you think it is. It looks like a correct or syntactically correct C program, and then go through it, step through it or at least a simple version of it, and see that it gives you the result you expect. It might even start with some sample program that you'll modify and here's a very simple sample program. It's just in main void. Curly brace, curly brace, return zero semicolon. When you're finished writing that code in editor, so I've already written it on paper, I then go and open my editor. My editor command in this case would be VI. I would say VI of sample.C. Typically, when I'm writing code for a C compiler, I have a suffix dot C that indicates to the compiler that this is a C code. Also if it sits in a folder or in directory, I can recognize it as being source, what we call source C code. Then I'm going to actually make sure the program works as I thought. So we'll call in our GCC compiler, we'll see if there are any syntax errors. When we fix all the syntax errors, we can recompile. The fix is going to have to require use of the editor again, and keep running the program. We either get wrong answers. We go back here fix, recompile, run, and then finally we should get a behavior we like, that's correct. Then in the GNU compiler you'll see an output file will automatically show up, which is your runtime executable code. You can think of that as machine code, and that file is by default a.out. The problem with having a.out as your executable is, anytime you use the C compiler, the a.out will be replaced if you have compiled the correct C program. So in order to avoid that, you can either change this by moving it to something recognizable for example sample.exe, or you can do this from scratch by using the GNU command minus o, means compile sample.C, and then the output should be in sample.exe. Now, we're going to actually go over and in the next segment, show that show me doing all this on my Macintosh environment.