Visual Studio 2003 compatible with Xcode for C++

Discussion in 'Mac Programming' started by BigPrince, Jan 24, 2007.

  1. macrumors 68020

    Dec 27, 2006
    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.
  2. macrumors 6502a


    Jan 4, 2002
    Austin, TX
    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.
  3. Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    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.
  4. thread starter macrumors 68020

    Dec 27, 2006
    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.
  5. Moderator emeritus


    Jun 15, 2000
    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: View attachment 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 :)
  6. macrumors 6502a


    Aug 22, 2003
    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.
  7. macrumors regular

    Apr 25, 2001
    Montreal, Canada
    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
  8. Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    To make it more fun, Mac OS 9 and earlier used a different character.
  9. macrumors 6502a


    Feb 24, 2004
    London, UK
    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!
  10. macrumors 6502a

    And Excel's exported text still does
  11. macrumors 68020


    Nov 15, 2005
    I've had success copying and pasting my code via gmail emails to myself between Xcode and VS.
  12. macrumors 68020


    Apr 12, 2006
    Long Island
    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.

Share This Page