1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

x code question

Discussion in 'Mac Programming' started by benlangdon, Mar 6, 2008.

  1. macrumors 65832

    benlangdon

    #1
    so installed x code but now im trying to use it and its um... where do i write?
    i am doing very basic c++
    so... where do i start this thing? i have no idea what im doing ive used code warrior once and eclipse on a pc very very briefly

    any help thanks
     
  2. macrumors 6502a

    #2
  3. macrumors 65832

    benlangdon

    #3
    is this only c because i need c++
    man i wrote this program up and it doesn't work i need to know how to just change it to compile c++
     
  4. macrumors regular

    #4
    The Dave Mark book does not cover C++.

    You need to create a C++ Tool project. Start Xcode, and choose File > New Project. A dialog box with a list of project types will open. Select C++ Tool, which is in the Command Line Utility section.

    If you click the link in my signature, you can find an article that walks the reader through the creation of a simple C++ program in Xcode.
     
  5. macrumors 65832

    benlangdon

    #5
    thanks i already figured it out though.:D
    if you could help me with one last thing :)
    when you enter in a variable when running the program how do you write the code so that it can be a decimal. don't you put a % somewhere:confused:
     
  6. macrumors 603

    Cromulent

    #6
    float varName = 0;

    scanf("%f", varName);
     
  7. macrumors 6502

    #7
    Or, using C++ (like specified), just use cin.
     
  8. macrumors 65832

    benlangdon

    #8
    :confused:

    where do i put cin:confused:
     
  9. macrumors 603

    Cromulent

    #9
    I think you should probably spend some time learning C++. Read http://www.cplusplus.com/ and buy yourself a good book. It will come in handy.
     
  10. macrumors 65832

    benlangdon

    #10
    ya i know im taking computer science right now so... ya my teacher can barrely speak english and says ok and right at least 200+ times during class so its ...
     
  11. macrumors 6502

    #11
    Try not to judge your professors just for that. I had a professor in uni that was like that, but was also one of the few professors who actually knew what he was saying (probably the best in the major at my uni)... not to mention it doesn't look like you can write English very well either
     
  12. macrumors 65832

    benlangdon

    #12
    ya, i know i get it.
    she used to work for ibm.
    but still i cannot understand what she says.
    also, determining my english skills based on how I type on a forum is ;)
     
  13. macrumors member

    #13
    lolol:D:D
     
  14. macrumors 68020

    Willis

    #14
    why use c++ when surely it would be more straight forward to use Obj-C...
     
  15. macrumors 65832

    benlangdon

    #15
    its for my class...;)
     

Share This Page