Qsr Nrwn
Website
C Programming Language
Hi you all! Still surfing or just browsing? Well�, by now you will know how does my eternal romance with C begins. I started programming on a 80286 clone without hard disk drive, and two floppy drives. I remember how bothering was to try to read a floppy while your prompt asked: 'Bad command or file name.' or so, so you have to insert again the OS floppy and try to execute the command issued moments earlier.
Well in this enviroment, on late Elementary school I took a class about programming, where the teacher just started to write the source code into the blackboard, and urged us to copy it. I only remember the screaming of the piece of chalk while she wrote down all the programme. If my memory is not so bad, programme was about the cannonical 'Hello, World!'
Time passed, and after four or five sessions typing all code from blackboard, I started to lose attention about the things about programming. Some time latter we started with concepts about batch programming, filters and redirection. I started to create some interesting (and long batch scripts). For some time that was the only kind of programming I used to do.
While being in the first year of Secondary school (which for English readers is equivalent to seventh grade), I win a bet (was about to learn all elementary algebra in a three month period) to my father and asked him to buy me a 'programmable' calculator. Was a Casio fx-6300G scientific graphics, which time to time I still see in some market places. I started to create 'programmes' for my Math homeworks (I used to be lazy about repetitive chores), so I managed to create a program to solve the general quadratic equations via general formula.
Programmes began to grow bigger and the 400-step (bytes?) boundary was a hassle. Even with this limitations I wrote a programme about Virgènere encryption algorithm (I preserve a copy of the original source code). On an avanced class I took again Programming subjects with a different view. So I started to write programmes during the high school and sophomore in GW-Basic compiler � what a mess! �, in my brain damage stage. For melancholic reasons I keep a copy of it in my HDD. Eventually in my first year on Medicine, browsing about compilers I found the TC 2.01 on Borland Community Museum, and snooping in a used bookstore I found and bought the Turbo C Bible which luckily corresponded to the Turbo C version I previously downloaded. I started to copy from the pages the different source code examples, and for the last six (soon to be seven) years I use to program in this compiler.
For some reason I will recommend to you to read next definitions taken from The Hackers' Dictionary e-text.
if (cond) { <body> }
if (cond) { <body> }
if (cond) { <body> }
if (cond) { <body> }
Well all my source code will be in the Allman style, because it's more organised than the other three. I use to format all source code with a powerful tool call NiceC hopefully available for download from my website. Just take your time to read documentation and format source code at your wish. I just have read the readme.txt file and found is free software and as recommended I do not intend to wrote that piece of software, so if you want to read the readme file just follow this link (I properly formatted it to fit in an HTML document)
For all functions, I will use the scheme proposed in Nabajyoti Barkakati's book "The Waite's Group, Turbo C Bible" (ISBN 0-672-22631-6), on its page xiii, with two minor modifications: I won't use the Compatibility bullet. Instead of it, it will use a "Full-ANSI compliant", "Semi ANSI-compliant", " Non-ANSI Compliant". For the footer of each section, if it is a borrowed source code or it is a contribution the proper credits will be placed (if possible) on it to the corresponding people or organisations. So let start with a primer of this scheme.
Compliant | A bullet appears if function is Full-ANSI compliant, Semi-ANSI Compliant or Non-ANSI Compliant. |
Purpose | Short description of where function is used. |
Syntax | Full ANSI prototype. Show declaration arguments also. |
Example Call | Shows how function is used. |
Includes | Lists included files needed by the function with an explanation of why each is needed. |
Description | How the function works and how you should use it. |
Common Uses | Situations in which the function is helpful. |
Returns | The value returned by the function, if any. |
Comments | Special notes that might help you avoid mistakes, and use the function effectively. |
See also | Related function and how are they related. |
Examples | One or mor complete example programmes illustrating how function is used. |
Author | Authors name, surname(s), nick (if he or she uses it) and if available, a link to his or her website. |
Oh, I almost forget to say two things: First, I have been forced to use M$-DOS in all its bitter flavours, ranging from DOS 1.0 to Win?-XP Pro Edition. I, during the forecoming years, will use if I could the Linux OS. Second, all my functions, for some reason, will be about cryptography, and will be placed outside US.
© 2004 Qsr Nrwn