These are the Preprocessors of C language that can be used to make programming FUN !
Welcome to Newbie Programmer Series. In the last post (click here) We have discussed a preprocessor called #define. In this post, we will discuss some more of them. Well, this series is made for those who are absolutely new in the programming world. So to keep everything simple and easy, I would not go too deep into the language features. But to introduce you, I am discussing below some more preprocessors that you will find while reading some sources of C programs. So if you are new to this series, please go to index (click here) and read out all the previous parts so that you can easily understand what I am discussing below.
#include < filename >
#include "filename in the source file directory"
In C language, there are MAY BE many things which are already defined. This #undef is used to remove that definition. Like in some of your code you have added :
#define PI 3.14
In some file, you want to use PI as 3 only. And this change is to be made in a particular file only. Then you can do something like this :
#undef PI //this will remove its value #define PI 3 //redefining new value
#ifdef #ifndef #endif
#ifndef PI #define PI 3.14 #endif
#ifdef PI #undef PI #define PI 3 #endif
Please share this as much as you can so that we can get connected with more and more people who want to learn programming.