I'm taking an algorithm design course for college and it requires a C++ Compiler. I downloaded Visual C++ Express 2008, but can't register it, so I decided to stick with the native Xcode 3.2. I am only having one problem that I can't understand between Visual C++ and Xcode, and that's something about breakpoints. When I run this program"
and build it I don't get any errors. I was able to run this same program with Visual, however whenever I run the program with Xcode and input a name, I get this,
I just can't figure out how to resolve this. I tried messing around with the breakpoint button in the command window, but nothing seems to work. This is the only thing that seems to be blocking me from making a trouble-free move from Visual to Xcode, and any help would be greatly appreciated!
Code:
/*
* File: helloYou.cpp
* ---------------------
* This program prints a more personal greeting
* by reading in the name of the user.*/
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name = "";
cout << "What is your name?: ";
cin >> name;
cout << "Hello, " + name + "!" << endl;
return 0;
}
and build it I don't get any errors. I was able to run this same program with Visual, however whenever I run the program with Xcode and input a name, I get this,
Code:
test(2019) malloc: *** error for object 0x100006280: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
I just can't figure out how to resolve this. I tried messing around with the breakpoint button in the command window, but nothing seems to work. This is the only thing that seems to be blocking me from making a trouble-free move from Visual to Xcode, and any help would be greatly appreciated!