PDA

View Full Version : Visual Studio 2003 compatible with Xcode for C++




BigPrince
Jan 24, 2007, 07:29 PM
Hey, I just started learning C++. At school we use Visual Studio 2003. If I do thing in xCode, will things go smoothly if I try to open the code in Visual Studio? Anything special I need to do.



Sayer
Jan 24, 2007, 08:22 PM
Anything special I need to do.

Yes. Stop typing xCode instead of Xcode.

C++ files are just text, so they will open anywhere. The project (the thing the IDE, e.g. Xcode, uses to manage files and builds) is program-specific.

bousozoku
Jan 24, 2007, 08:48 PM
You'll only have to pay attention to the line endings in the editor because VS 2003 could become confused.

Standard C++ will work in any compliant compiler, but often instructors will use DOS/Windows only methods to handle text-only programmes.

BigPrince
Jan 24, 2007, 09:46 PM
I dont even know what line endings are.

I am basically starting out with messing with Arrays and filling them up with numbers from an input file, taking the average, sorting them, searching and what not. If I do try it in Xcode, I will let you know my sucess.

kainjow
Jan 24, 2007, 10:12 PM
I dont even know what line endings are.

It's how a new line in a text file is represented (when you press Return/Enter on the keyboard?). On Mac OS X/*nix, it is represented with a 1-byte character, while on Windows it is 2 bytes, but a *smart* text editor will display them both the same.

Here is an example file: 66847 - If you load it in TextEdit on Mac OS X, it loads correctly. If you load it in NotePad on Windows, it won't, because NotePad doesn't read *nix-style line endings (WordPad does though). It's what makes Windows special :)

csubear
Jan 24, 2007, 10:23 PM
Hey, I just started learning C++. At school we use Visual Studio 2003. If I do thing in xCode, will things go smoothly if I try to open the code in Visual Studio? Anything special I need to do.

Opening c++ files, yes.
Opening .vcproj, no, well it won't open a project or anything.

Last time I check Visual Studio's stl implementation does some non-standard stuff.

From Win to Mac
Jan 24, 2007, 10:29 PM
For now, you should be fine because you're doing basic stuff. As a general rule of thumb, anything in your C++ Beginner book will work on Windows, Mac, and Linux, unless otherwise noted.

But the moment you start doing anything more, like creating a user interface (with Windows Forms or MFC), start including windows specific libraries (using the "#include" command, like windows.h), or networking, it won't work.

You've just started though, so you should be fine. You have a lot of stuff to see before you venture in Windows libraries... Know what Object Oriented is ? :p

bousozoku
Jan 24, 2007, 11:06 PM
It's how a new line in a text file is represented (when you press Return/Enter on the keyboard?). On Mac OS X/*nix, it is represented with a 1-byte character, while on Windows it is 2 bytes, but a *smart* text editor will display them both the same.

Here is an example file: 66847 - If you load it in TextEdit on Mac OS X, it loads correctly. If you load it in NotePad on Windows, it won't, because NotePad doesn't read *nix-style line endings (WordPad does though). It's what makes Windows special :)

To make it more fun, Mac OS 9 and earlier used a different character.

Palad1
Jan 25, 2007, 04:51 AM
If you start doing ATL / MFC or even Win32 user interfaces, you're stuck though.

Your only option would be to use a cross-platform third-party GUI tookit such as wxWidgets but doubt your MFC prof. would be happy to learn wxWidgets just for you.

Good luck!

AlmostThere
Jan 26, 2007, 02:45 AM
To make it more fun, Mac OS 9 and earlier used a different character.

And Excel's exported text still does

bobber205
Jan 26, 2007, 08:56 AM
I've had success copying and pasting my code via gmail emails to myself between Xcode and VS.

pilotError
Jan 26, 2007, 09:36 AM
As far as conversion, You can use FTP in text mode. If available. I think wordpad allows you to save as DOS text.

When FTP'ing (or cut/paste) from the PC, just do a dos2unix on the text file.