Explain Preprocessing

39 replies [Last post]
Isaac Yates
Isaac Yates's picture
Title: NooBot
Joined: 12/14/2013
Posts:
BotPoints: 19
User offline. Last seen 8 years 8 weeks ago.

Hi,

I am confused about a c programming concept. It has to do with the #ifndef and the #define. I understand that #ifndef DEFINITION checks to see if there are any previous #define DEFINITIONs called. My question is, why is this useful? An example I have run across was written by a retired team member:

#ifndef __OPENCODE_H__
#define __OPENCODE_H__

the header file then proceeds to include a number of headers that make up opencode, and then ends the file with a #endif. Here is the whole header file:

#ifndef __OPENCODE_H__
#define __OPENCODE_H__
#ifndef __arm__
#include "../config/cbcconfig.h"
#endif
#include "opencode/common/depthlib.h"
#include "opencode/cbc/drive/drivelib.h"
#include "opencode/cbc/light/lightstart.h"
#include "opencode/cbc/sensor/sensorlib.h"
#include "opencode/cbc/sensor/link_depth.h"
#include "opencode/cbc/servo/servolib.h"
#include "opencode/create/create_accel.h"
#include "opencode/create/create_config.h"
#include "opencode/create/create_drive.h"
#include "opencode/create/create_music.h"
#include "opencode/create/create_script.h"
#include "opencode/create/create_sensor.h"
#include "opencode/create/create_align.h"
#include "opencode/create/create_depth.h"
#endif

From what I can tell it has to do with something called preprocessing? Can someone explain to me importance (or unimportance) of defining __OPENCODE_H__ at all. I'd like to be able to intelligently write my own libs in the future (and teach others how to), and this seems important. Thanks.

“I have never let my schooling interfere with my education.” ~Mark Twain

Ponivnret
Title: NooBot
Joined: 07/29/2016
Posts:
BotPoints: 22
User offline. Last seen 6 years 43 weeks ago.

Thanks for making such a cool post which is really very well written.will be referring a lot of friends about this.Keep blogging.
get help with file explorer in windows 10

laurenjane
Title: NooBot
Joined: 08/29/2016
Posts:
BotPoints: 12
User offline. Last seen 6 years 35 weeks ago.

Well in my knowledge i think C is the easiest language if compared to Java,PHP etc.
Yes even better ans easier than HTML too.simple coding and features make it popular.
https://medium.com/@JauraJones/online-assignment-help-for-college-studen...

Rosealvin
Title: NooBot
Joined: 11/07/2016
Posts:
BotPoints: 4
User offline. Last seen 6 years 28 weeks ago.

I counsel you to pay money for from me bullion sophisticated by fire so that you might be wealthy, and pallid clothes to put on so that your disgraceful nudity may not be naked, and buy soothe to spread on your look at so that you may watch. Assignment Help – Assignment uk

daisyfaith
Title: NooBot
Joined: 03/22/2017
Posts:
BotPoints: 60
User offline. Last seen 4 years 6 weeks ago.

I counsel you to pay money for from me bullion sophisticated by fire so that you might be wealthy, and pallid clothes to put on so that your disgraceful nudity may not be naked, and buy soothe to spread on your look at so that you may watch. buy thesis paper

annetrose
Title: NooBot
Joined: 07/06/2017
Posts:
BotPoints: 30
User offline. Last seen 5 years 17 weeks ago.

I think this is a relevant topic to get discussed and will be useful to students those who are studying programming. If you explain each program with a sample source code or its logic, then it will be more helpful to them to grasp the concept quickly.

hellenjos
Title: NooBot
Joined: 07/03/2017
Posts:
BotPoints: 128
User offline. Last seen 5 years 1 week ago.

I am really fed up with this topic as I had tried many times to learn the concept but I didn’t understand a little bit of it. I have gone through this blog and found that the author share the idea in very simple way. Thanks for the great effort.JoyJolt highball glass

milanjoy
Title: NooBot
Joined: 06/13/2017
Posts:
BotPoints: 756
User offline. Last seen 5 days 11 hours ago.

I think this programming concept was most commonly used in viva and other exams. Preprocessing is a common topic and sometimes there should be a chance for deviating from your concept. I think students require a professional answer for this. Hope that you will definitely provide it here.private louvre museum tour

muneer ahmed
Title: NooBot
Joined: 02/07/2018
Posts:
BotPoints: 70
User offline. Last seen 4 years 35 weeks ago.

Truly an extraordinary expansion. I have perused this wonderful post. A debt of gratitude is in order for sharing data about it. I truly like that. Much obliged so part for your meet.  1xbet

aftabak
Title: NooBot
Joined: 07/15/2018
Posts:
BotPoints: 20
User offline. Last seen 4 years 12 weeks ago.

Specialists examination gives you a reasonable thought of the qualities and shortcomings of the NBA Basketball groups and players contending in the competition. William hill

muneer ahmed
Title: NooBot
Joined: 02/07/2018
Posts:
BotPoints: 70
User offline. Last seen 4 years 35 weeks ago.

You simply need to see your wagering exercises from an altogether unique point. Ideally, this football wagering aide will assist you with becoming a football lay wagering victor by giving you an essential comprehension of football lay wagering and lay wagering as a rule. sportnation