4th Oct 2018, 4:01 PM
Lata Mishra
Lata Mishra - avatar
3 ответов
+ 3
That's because the compiler doesn't recognize the sign for PI like we humans do. For the compiler, it's just a sign that it doesn't know and cannot work with. Instead, try to declare a constant variable PI, either per #define or const, and to use that in your code.
4th Oct 2018, 4:32 PM
Shadow
Shadow - avatar
+ 1
If you copy+pasted this code from a place it worked, that place probably had: * Visual Studio, or... * a preprocessor in PERL * a patched compiler (SOURCE_CHARSET is changed to "C99" in one place) As indicated in this reference: https://stackoverflow.com/questions/7899795/is-it-possible-to-get-gcc-to-compile-utf-8-with-bom-source-files The code does compile with the UCN identifier for π (because -fextended-identifiers is a default flag): float radius, ..., \U000003C0; but as far as I know, there's no "helper" here so you can just use utf8 identifiers in your codes. So... Shadow's response is correct here for SoloLearn.
4th Oct 2018, 11:59 PM
Kirk Schafer
Kirk Schafer - avatar
5th Oct 2018, 1:49 AM
Lata Mishra
Lata Mishra - avatar