Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#define pi 3.14
#ifdef __unix__ /* __unix__ is usually defined by compilers targeting Unix systems */
printf("using linux");
#elif defined _WIN32 /* _WIN32 is usually defined by compilers targeting 32 or 64 bit Windows systems */
printf("using windows");
#endif
int main(int argc, char const *argv[])
{
int main(int argc, char const *argv[])
{
printf("Hello World!\nThis is pi number: %2f", pi); //This is a comment
return 0;
}
------------------------------------------------------------------------------------------------
# 1 "hello.c"
#define pi 3.14
printf("Hello World!\nThis is pi number: %2f", pi);
-------------------------------------------------------------------------------------------------
printf("Hello World!\nThis is pi number: %2f", 3.14);
#define AND &&
#define OR ||
#define PI 3.14
#define EXCELLENT (a>=75)
#define ALERT printf("Security Alert!!")
#define MIN 1
#define MAX 9
#define MIDDLE (MIN+MAX)/2
#define ISEXCELLENT(x) (x>=75)
#define ISLOWER(x) (x>=97 && x<=122)
#define HLINE for(i=0; i<40; i++)\
printf("_");
#include <stdio.h>
---------------------------------------------------------------------------------------------
# 1 "hello.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
struct foo
{
int member;
};
#include "grandparent.h"
#include "grandparent.h"
#include "parent.h"
struct foo
{
int member;
};
struct foo
{
int member;
};