[SPCA] Continue summary

This commit is contained in:
2026-01-06 10:52:34 +01:00
parent 74205e8cf0
commit 13e3210298
20 changed files with 79 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
int my_int; // Allocates memory on the stack.
// Variable is global (read / writable by entire program)
static int my_local_int; // only available locally (in this file)
extern const char *var; // Defined in some other file
const int MY_CONST = 10; // constant (immutable), convention: SCREAM_CASE
enum { ONE, TWO } num; // Enum. ONE will get value 0, TWO has value 1

View File

@@ -0,0 +1,28 @@
#include <stdio.h>
#include <stdlib.h>
#define FOO BAZ
#define BAR( x ) ( x + 3 )
#define SKIP_SPACES( p ) \
do { \
while ( p > 0 ) { p--; } \
} while ( 0 )
#define COMMAND( c ) { #c, c##_command } // Produces { "<val(c)>", "<val(c)>_command" }
#ifdef FOO // If macro is defined, ifndef for if not defined
#define COURSE "SPCA"
#else
#define COURSE "Systems Programming and Computer Architecture"
#endif
#if 1
#define OUT HELLO // if statement
#endif
int main( int argc, char *argv[] ) {
int i = 10;
SKIP_SPACES( i );
printf( "%s", COURSE );
return EXIT_SUCCESS;
}