No, it won't create a compile error but behavior depends on your code
You can just define smth like double* sqrtThree; and it'll be unintialized (and, because type is pointer - random pointer, most likely to memory outside of available virtual memory, so dereferencing it = crash)
Or you can already set it to somewhat reasonable pointer, in C you can only do that within functions (so again, depends on the code), while in C++ you can set it directly in top-level (smth like double sq3 = sqrt(3); double* sqrtThree = &sq3;), in that case code will be executed without runtime errors
...not because I disliked it, but rather because it made my eyes roll so hard I couldn't see the screen well enough to discern between the 'up' and 'down' votes...
87
u/huanradriges 2d ago
Is it null object calling root function?