0

When to use #define?

for ex- #define PI 3.14

18th Apr 2018, 5:22 PM
ELECTRICAL ENGINEER
ELECTRICAL ENGINEER - avatar
1 Resposta
+ 2
https://stackoverflow.com/questions/6274008/why-would-someone-use-define-to-define-constants?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa But also useful to stop a .hpp or .h file being processed more than once. #ifndef __fred__h__ #define __fred__h__ // put innards of .h file here. #endif
18th Apr 2018, 6:28 PM
Emma