Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / #ifndef

Author
Message
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 12th Mar 2009 07:53
What is this for and what does it do?:

prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 12th Mar 2009 09:38
I don't really know, but i would guess that #ifndef ... endif is "if not defined do this.... end if"
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 12th Mar 2009 09:45
Prasoc is correct.

What you have there is a header guard which ensures that if the header file is included twice, the functions are only defined once because on the second time _my_header_h_ will be defined. This situation can occur in multi file projects. You can also use #pragma once which is designed to do the same thing, but can vary between compilers.

Login to post a reply

Server time is: 2024-11-25 17:56:41
Your offset time is: 2024-11-25 17:56:41