I am using Apple LLVM version 7.3.0 (clang-703.0.31) to compile some code and I find that 1j could be a constant value.
In the following code snippet, I assign int b with value 1j and it compiles.
But j is not any variable I have defined.
Can anybody explain what is 1j? Or it is a compiler bug?
Thanks a lot.
#include <iostream>
using namespace std;
int main() {
// What is 1j? Why this code can compile??
int b = 1j;
cout << b << endl;
return 0;
}
I have seen another post explaining this is complex number.
What does the integer suffix J mean?
And using compiler option -pedantic would raise a warning for it.