(adsbygoogle = window.adsbygoogle || []).push({});
Sup boi this is my first C programming Tut. C is a very good language to learn and if you want to learn C++ I recommend learning C first. These tuts will not cover the history or anything like that it will only cover the code so before we begin here is a good resource that is good to use for references do not READ it work it what i mean by that is write out all the examples and try to do the exercises*C.*
C Programming Language, 2nd Edition*
So lets begin so in this tut i will go over a simple program which is the Hello world program to make this we use the code below.
int main(){
* *printf("Hello World);
* *getchar();
}
The above code will print the text Hello World to the console and then will wait till the user has pressed ENTER or clicked the x to close the program.
So the first line that will be executed is int main(){} this is a function we use functions to store all of our code in unless you want code to be global. Everything between the {} are called statements. Statements should usually end with ; but sometimes do not. If you have have some previous programming knowledge in C# you might of heard of a method or in vb.net you might of heard of sub routines they are just functions with different names don't ask why I have no idea why.
The next line that will be executed is printf("Hello World"); this will print hello world to the console as printf is used to print characters to the console.
The last line that will be executed is getchar(); without it the program will open and close really fast so we use getchar(); so it will wait until we press ENTER or click the x to close the program.
so that's my first tut done i know its really short but there is no point in learning a lot of stuff and then having to learn it all the next day because you cant remember it.*
Exercises:
make your own program using printf and getchar make the output be you name and age and make sure they are commented // <- that's a comment.*
If you want more just say