# Defining constants in the original standard of C [closed]

I'm learning C using Mike McGraths 3rd edition. I know the book is old but I want to have a better appreciation for the changes made to C through its timeline. The compiler error is error: ‘SYSTEM’ undeclared (first use in this function).

#include <stdio.h>
#define LINE "______________________"
#define TITLE "C programming in easy steps"
#define AUTHOR "Mike McGrath"
#ifdef _WIN32
#define SYSTEM "Windows"
#endif
#ifdef Linux
#define SYSTEM "Linux"
#endif
int main()
{
printf("\n \t %s \n \t %s \n", LINE, TITLE);
printf("\n \t %s \n \t %s \n", AUTHOR, LINE);
printf("\n Operating System: %s \n", SYSTEM);
return 0;
}

• I doubt the book is from 1956, as C didn't exist back then. Do you mean 1995, as Linux would exist by then... – Wim ten Brink Nov 12 at 10:40
• Yes you're right my mistake. – Martin Nov 12 at 10:45

The simplest fix is to replace #ifdef Linux with #ifdef linux. Take a look at this reference for more.
• @Martin Or you could use #elif. See description here – Peter Jennings Nov 12 at 10:53