¶N¤¢01ž02C - FOR BEGINNERS!ž01 ¢02 Written by: ¢03Spirit/Devious. ¢02 No doubt, programming in C is difficult. But prorgamming in C becomes a piece of cake after you get a taste of C++. The problem with C is that its very soft, like in assembler, in C or C++ you can do to your system as you wish. In contrast to Pascal and Basic, C lets you do so much more with more freedom, Pascal for example was developed as a learning language for students, and Basic, well, no matter what sort of Basic you think of, the next thing that comes to mind is '¢03whats the point¢02'. Anyone that thinks Basic or Pascal is the best thing since sliced bread has got to be engaged to his IBM. COBOL, yeh , well, I can safely say that Cobol is such a strict language that at the worst, all it does is complain. Cobol is an industrial language often used on ¢01UNIX¢02 , ¢01VAX¢02 , ¢01CRANE¢02 mainframe computers. Speaking from experience I can confidently ¢03NOT¢02 recommend Cobol even if I passed both my Cobol schooling units,ofcourse,unless some business firm pays you enough money to buy CBM. For the moment C, assembler, and Arexx have got to be the best languages to date. C is very modular, everything is a Function. Lets write a little C program. ¢03 void main () /* this is a comment */ { /* open brace Start */ } /* close brase end */ ¢02 To have a C program, you must have the function main,by the way C is case sensitive. A function Starts with { and ends with } braces. ¢03 #include /*functions here*/ void main () { int num,no;float a;char x; printf ("hello\n"); /* the printf */ printf ("number seven %d ok",(14/2)); printf ("type a number"); scanf ("%d",&num); printf ("num is %d",num); } ¢02 C offers a lot of libraries and functions, in this example we included a file called stdio.h, stands for standard input output header. And just after that its being used in the main function as printf and scanf. There is are 2 integers by the name of num and no. The \ is a special escape code. \n means new line and \t means tab. Every command must end with a semicolon. The second printf prints '¢03number seven 7 ok¢02'. See how the output is supplied in the printf (14/2). The % symbol is also a special qualifier, it literaly means to expect input or output, what follows the % is the type of I/O. In printf % is output description,and scanf is the input. There are many types of variables %d integer, %f float , %c character %s string (many characters) %ld long integer and a few more variations. The scanf expects a numeric value, and the last printf prints what is in the num variable. Now that you have a taste of C , its not as frightening as you thought, C is also very detailed and complex. C++ is essentialy the same as C, but C++ involves new and challenging concepts in managing and handling its data, the main aspect of C++ is object orientativity. It would be too difficult and long a task for me to teach anything realy useful. But if you didnt know a thing about C you now know a few things. To effectively learn C you must have an ANSI C maual, to Apply C to your amiga hardware you need tutorials about all the system interfaces and/or libraries etc. I recomend SAS C 6.5+, its what I use on my amiga, SAS offers both C and C++ and seems to me as the best C on amiga so far.