Hi, I am new to Xcode and C++. I created a helloword project and the main.cpp file is created automatically.
#include <iostream>
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
I tried to run this program by clicking the Run under Product. It said "Compile Successfully" but then I ran into
Thread 1: EXC_BAD_ACCESS (code=2, address=0x7fff23947cb1)
and the program remained on running without termination.
I'm using BigSur (11.2) and I can run the code in command line with
>>> c++ main.cpp
>>> ./a.out
Hello World!
but cannot run this code inside Xcode.
Any idea why this is happening?
Thank you for helping!
Selecting any option will automatically load the page