my C files
// All these code is an adaptation to the
// Caleb Curry C course (that course taught me a lot)
// I prefer to code using GNU/Linux
// You can use Emacs or Vim to study these code
// Generally I tend to avoid vsCode (code)
// But, do whatever you want...
/* There is codeBlocks which is an opensource editor and can be installed in M$ as well */
// Variables
// int x = 20;
// int is a integer type; "x" is the variable name; "=" is an attribution sign (it is not a equal sign); 20 is the variable value
// this is an expression that declares and initialise the "x" variable
// int y = x / 2;
// "y = x / 2" is an expression that evaluates (resumes/calculates) to a single value
// printf("%i\n", 123)
// "%i" is a placeholder to an integer
// printf("%i\n", y)
// "%i" is a placeholder to an integer
// printf("The magic number is: %i\n", y);
// printf("The magic number is: %i\n The value of x is %i\n", y, x);
// two integers placeholders
// int x = 10;
// this expression is called hard coding
// Comments
// Single line comment (can go before the code in a single line or after the code)
/* Multi-line code can go before the code. e.g.: in the heading of a code or after the code */
/* You can put marks on your code as well to visit them later. Like so:
// TODO
// fixIT
*/
// Data types
// int tocos = 5; // integer
// int x = 12 / 3; // integer
// double y = 3.4; // double
// float y = 3.4; // float
// numeric types
/* primitive data types are indivisible/atomic. They are used as building blocks */
// complex (structured) data types
// e.g.:
// date today;
// coordinates 101;
// linked lists
// Arrays
// int grade [10];
// char ballons [3];
// "I do not like cats" // strings - a sequence of chars
// "\0" // the "nul char" which ends a string
// Array elements
// Constants
// int cats = 98;
// '3' - a char
// "3" - a string
// 3 - a integer
// double cats = 98.5 // a float (double) type
// float cats = 98.5 // a float (float) type