Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DaKyd55

macrumors member
Original poster
Jul 3, 2010
81
0
it may be the program it was working b4 but it is doing this for other bits of code too. heres what i put in and what it returns with for any code i put in any project. what should i do?:confused::confused::confused::confused::confused:
 

Attachments

  • prob.jpg
    prob.jpg
    41.2 KB · Views: 119
Your code looks correct & works fine for me; behaves exactly as one would expect it too. Try writing it as a stand alone .cpp file (New > C++ File in Xcode...if that's what you are using).




Code:
/*
 *  hellow.cpp
 *  
 *
 *  Created by [] on 7/17/10.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */


#include <iostream>

using namespace std;

int main()
{
	cout << "Hello world!!" << endl;

	return 0;

}

You really don't need that end line after the cout statement. The ; is enough.


Code:
/*
 *  hellow.cpp
 *  
 *
 *  Created by [] on 7/17/10.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */


#include <iostream>

using namespace std;

int main()
{
	cout << "Hello world!!";

	return 0;

}
 
Seems like a encoding problem where " isn't being registered as the correct character? Tried using a direct text file and g++ instead of CODE::Block?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.