Which is better:
#define PI 3.14
or
const double PI = 3.14;
This was an interview question, and I don't seem to find an unambiguous answer.
I suppose I should prefer not to use macros, but I'd like to have a sturdy answer to this.
EDIT: So the question marked duplicate says, that define "don't respect scopes", but I don't really want scopes here, I want something like a super global, PI must be PI everywhere, should be accessed from anywhere. #define seems more reasonable here to me.
Also I don't see where could using PI go wrong in compile time so please provide an example.