• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
0

When to use #define?

for ex- #define PI 3.14

t
18th Apr 2018, 5:22 PM
ELECTRICAL ENGINEER
ELECTRICAL ENGINEER - avatar
1 Answer
+ 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

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Issue with Sololearn Module Quiz Despite Correct Answers
2 Votes
I need help to solve this
0 Votes
Project
0 Votes
Engineer Cloud
0 Votes
Lua?
1 Votes
Hey what the research process order for them that I am telling you please order them and tell me answer
0 Votes
How to add comment in python?
0 Votes
How do we code calculator
0 Votes
Ayuda para insertar la imagen de portada y las melodĂ­as a mi ĂĄlbum alguien sabe cĂłmo
0 Votes