mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-07 23:37:32 +02:00
@@ -30,9 +30,11 @@ Multi-line comments don't nest /* Be careful */ // comment ends on this line...
|
|||||||
#define DAYS_IN_YEAR 365
|
#define DAYS_IN_YEAR 365
|
||||||
|
|
||||||
// Enumeration constants are also ways to declare constants.
|
// Enumeration constants are also ways to declare constants.
|
||||||
|
// All statements must end with a semicolon
|
||||||
enum days {SUN = 1, MON, TUE, WED, THU, FRI, SAT};
|
enum days {SUN = 1, MON, TUE, WED, THU, FRI, SAT};
|
||||||
// MON gets 2 automatically, TUE gets 3, etc.
|
// MON gets 2 automatically, TUE gets 3, etc.
|
||||||
|
|
||||||
|
|
||||||
// Import headers with #include
|
// Import headers with #include
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -57,7 +59,6 @@ int main() {
|
|||||||
// print output using printf, for "print formatted"
|
// print output using printf, for "print formatted"
|
||||||
// %d is an integer, \n is a newline
|
// %d is an integer, \n is a newline
|
||||||
printf("%d\n", 0); // => Prints 0
|
printf("%d\n", 0); // => Prints 0
|
||||||
// All statements must end with a semicolon
|
|
||||||
|
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
// Types
|
// Types
|
||||||
|
Reference in New Issue
Block a user