Why is the data type of PI not specified | Sololearn: Learn to code for FREE!
Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję
+ 1

Why is the data type of PI not specified

After the #define there is no data type for PI, why is that

5th Dec 2018, 4:16 PM
Josh
Josh - avatar
1 Odpowiedź
+ 4
Assuming the language is C or C++ (Please add the language in the keywords!) #define is handled by the pre-processor, not the compiler. And PI is a placeholder, not a typed C variable. The pre-processor is just replacing all occurrences of the string PI in the source code with the defined value (as a replacement string) then the compiler compiles the resulting processed source code.
5th Dec 2018, 4:44 PM
ifl
ifl - avatar