Yesterday was my first day ever of programming in C. And I must admit it was harder than I thought to get my C/C++ environment set up. First of all, I had to wait until I got the book on C Programming, which I had reserved from the library. It came in later than I thought, which meant more delay for me. Well, it finally arrived a couple of days ago, and that was when I was hit with about a thousand school assignments. Talk about bad timing. 😛
It took me an age to get those out of the way, but then it was the weekend. So, yesterday, I finally sat down and opened my book on C programming. Now, before I could actually start writing and executing C, I had to set up a compiler, make sure I had a terminal window available,(You can view the output of the C programme, via the terminal window in most circumstances), plus a text editor.
Now, because that process is rather complicated, I decided to go with a package, that had the compiler, terminal window, and text editor, all in one. I checked to see which all in one package, the book recommended. Then, I downloaded Dev-C++ from Blood-Shed. Now you may notice that the name of the package is C++. It is still perfectly capable for C environments, you just need to set the programe so C is the default environment you’ll be working in.
Once I had chosen the recommended package, I waited over an hour while all eight megabites of the programme downloaded onto my computer. once that was completed, I followed my way through the installation steps, and finally completed the set up. Now, I thought my work was done, but it wasn’t – yet. As soon as the programme was up and running, I closed it down, and went to the folder where this package had its roots, and tried to start it up from there. Unfortunately, this was not successive, and each time I tried to start it from there, a message came up that told me I needed to install it, and it asked me if I wanted to. Now, if I hadn’t found another option to start it, without completely re-installing it, I may have continued wasting my time. So, after fooling around for a little while, I finally discovered another option to start it. When I clicked on it – yippeeee! – it came up, completely functional.
Now, I had just one last thing to do, before I could begin writing C. I had to set up it’s environment. When it came, its default was a C++ envitonment, which is not what I wanted. So, I changed the default settings to C. And, now I was ready to write (and hopefully execute), C programmes.
Well, I wrote my first script, and after debugging it to check for errors, I wanted to run the output of it in a terminal window. But when I tried opening the terminal, it flashed on and off very quickly. I read on in the book, and discovered that I needed to put a certain command in the programme so the terminal window flashes on, but doesn’t do anything without a keystroke. The output of my first programme written in C, was simply “Hello World”.
Stay tuned.
Dr Code