Need a c++ program for the Mac.

jcovercash

Diamond Member
Apr 24, 2001
9,064
0
0
Im taking c++ this year, and I am/have been thinking about getting mac, but before I order I want to make sure I can use it in the c++ class to program on.

We have not start using the program yet so IDK what the PC counter part is we are using I will find out tomorrow.

But as far as the mac goes whats a good program to use for c++ on it. Cheap/Free is best :). If I write a program on the mac, and I send my teacher the source on her pc. It should compile on her PC fine and run correctly even though I wrote it on the mac right?

I have very little programming background so far, just pascal, so I ahve never tried anything like this and just wanted to make sure it would work right before I bought one.


thanks,
Josh

PS If the above doesnt make sense its because its late and Im tired, just ask a question if you dont understand what I meant.
 

GiLtY

Golden Member
Sep 10, 2000
1,487
1
0
what compiler does your teacher use? Depending on the compiler your teacher uses, the code you wrote for GCC might not work on her computer -- because they have different standards.

if your teacher uses VStudio, I don't know if the code is compatible. I've tried to compile a C++ code i wrote for GCC in VStudio before, and it didn't compile. But other forum members are more knowledged in this field than me. Just my $0.01

--GiLtY
 

hopejr

Senior member
Nov 8, 2004
841
0
0
Xcode/GCC and VS .NET aren't compatible. If your teacher is using linux, it's more than likely that GCC is the compiler and that will be good (I have a mac, my school uses linux, and we're all happy). If your teacher uses Windows, GCC may still be used, but that's doubtful.

In code:

#include <iostream>

namespace std;

int main(void)
{

// XCode/GCC != VS .NET

if (teachersOS == "linux")
{
cout << "good stuff" <<endl;
}
else
{
if (teachersOS == "Windows")
{
if (compiler == "GCC")
{
cout << "great!" << endl;
}
else
{
cout << "no good" << endl;
}
}
}
return 0;
}

// I have no life :p

EDIT: where did all my indenting go???
 

JustMike

Senior member
May 25, 2003
234
0
0
As long as the GUI features of VS.NET aren't being used, most C++ code will be fully compatible.
 

jcovercash

Diamond Member
Apr 24, 2001
9,064
0
0
Originally posted by: JustMike
As long as the GUI features of VS.NET aren't being used, most C++ code will be fully compatible.

Yea we arnt doing any visual stuff, just basic program coding. I am going to ask her about it tomorrow when i go to her class before I order an Ibook.

Josh
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Originally posted by: AMDman12GHz
Originally posted by: JustMike
As long as the GUI features of VS.NET aren't being used, most C++ code will be fully compatible.

Yea we arnt doing any visual stuff, just basic program coding. I am going to ask her about it tomorrow when i go to her class before I order an Ibook.

Josh

For basic programming, you can write/debug/test in Visual Studio .NET then compile and test your code on the school's servers prior to submission. This is what I did throughout most of college (albeit with Visual Studio 6).
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: hopejr
Xcode/GCC and VS .NET aren't compatible. If your teacher is using linux, it's more than likely that GCC is the compiler and that will be good (I have a mac, my school uses linux, and we're all happy). If your teacher uses Windows, GCC may still be used, but that's doubtful.

In code:

#include <iostream>

namespace std;

int main(void)
{

// XCode/GCC != VS .NET

if (teachersOS == "linux")
{
cout << "good stuff" <<endl;
}
else
{
if (teachersOS == "Windows")
{
if (compiler == "GCC")
{
cout << "great!" << endl;
}
else
{
cout << "no good" << endl;
}
}
}
return 0;
}

// I have no life :p

EDIT: where did all my indenting go???

That's what "attach code" is for.

Also, using void for no argument functions is so C.
 

hopejr

Senior member
Nov 8, 2004
841
0
0
oops, I have been using c too much lately, and sorta forgot my c++ :p
I tried attach code but there was an error.