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

not
const char 'M'

Also, you are declaring the variable named M to be a character, which means it won't be able to hold the string "Monday".

Xcode uses GCC as it's compiler, and it's not Xcode (or GCC's) fault.
 
const char M

not
const char 'M'

Also, you are declaring the variable named M to be a character, which means it won't be able to hold the string "Monday".

Xcode uses GCC as it's compiler, and it's not Xcode (or GCC's) fault.

You can't declare a string as one character, can you? So remove the quotes, though? Okay.

Okay, good, that works, but it still wants a semicolon after cout (before the string)... is this where I need the single quotes?
 
You can't declare a string as one character, can you? So remove the quotes, though? Okay.

Okay, good, that works, but it still wants a semicolon after cout (before the string)... is this where I need the single quotes?

I don't understand the first question. What will print out will most likely not be what you want, though, I can almost guarantee that.

Second question: I see the other error - on the first cout like, you say:
cout m << endl;

cout doesn't work like that, everything has to be after the <<

Try:
cout << m << endl;

edit: why are you trying to use a char variable to hold a string anyway? Save yourself the headache and move everything to a string and call it a day.
 
cout << m << endl;

I... am an idiot. :p Thank you.

I already know two real languages and now they expect me to learn a third... what a world. :rolleyes:

Thank you. Turns out that XCode should do just fine...

Though my professor said that I should run everything through Bloodshed Dev C++ on a Windows or Linux box before turning it in.

But would I even need to, or will XCode's work be identical?

Thanks a lot, again.
 
.

Though my professor said that I should run everything through Bloodshed Dev C++ on a Windows or Linux box before turning it in.

Both Bloodshed and XCode use gcc so as long as you don't use any OS X frameworks, it should be ok.

But ... I would try compiling your code from the command line first.
 
I... am an idiot. :p Thank you.

I already know two real languages and now they expect me to learn a third... what a world. :rolleyes:

Thank you. Turns out that XCode should do just fine...

Though my professor said that I should run everything through Bloodshed Dev C++ on a Windows or Linux box before turning it in.

But would I even need to, or will XCode's work be identical?

Thanks a lot, again.

I've seen plenty of weird ****, even from gcc itself. For example, I wrote one program in Xcode, it compiled perfectly and ran on my machine perfectly. Nothing extravagant, just a basic CLI like you're attempting to create here. Recompiled the code on the server and it did nothing when executed. I checked that code a dozen times and I could never figure out what happened.

In short, yes, definitely try to compile the code with whatever your professor wants if at all possible.
 
XCode just uses GCC + Make which Dev uses. Unless you code a Cocoa GUI it should work on everything. Doesn't hurt to make sure though, get a Linux VM. (Ubuntu isn't the best for VM, try Fedora 10, not 11 or openSUSE 11.1)

NetBeanz or Eclipse with the C++ plugins are another option, XCode has a superior design though. That might be because I only Know Cocoa and Objective-C... :D
 
XCode just uses GCC + Make which Dev uses. Unless you code a Cocoa GUI it should work on everything. Doesn't hurt to make sure though, get a Linux VM. (Ubuntu isn't the best for VM, try Fedora 10, not 11 or openSUSE 11.1)

I could never get a simple gotoxy to work, even when I had the proper .h files and copied the code directly. That was my main concern for the class, but XCode always worked for everything else.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.