Apstring with Xcode

Posted:
in Mac Software edited January 2014
alright.



I got my new mac and im learnin C++ at school.



At school we use Apstring.cpp as our string variable.



1) If apstring is mac compatible where do i put the apstring.cpp and apstring.h files. What folder? Also i want conio.h.



2) Is there a string variable already included in the compiler. Ive searched around but i dont think so.



3) Also what is carbon and cocoa. How do i just do c++.



Thanks

Comments

  • Reply 1 of 2
    scottscott Posts: 7,431member
    Oh it's been a long time since I touched C++ so I'll get you started and then all the snotty code trolls will correct me and then you'll get a better answer.





    1) You put the files in whatever folder you want. So for me I have a projects folder and then sub-folders for each project. For simple stuff you can put it all in one folder for each project.



    As long as it's ansi C++ there's no Mac/PeeCee/Linux/Unix issue.



    2) I'm not sure I know what you are talking about.



    3) Carbon and Cocoa?



    http://developer.apple.com/



    They are APIs for making applications in OS X. If you wanna just do C++ then stick to a simple editor and the command line compiler, gcc.



    >man gcc



    Read the man page.



    Good luck
  • Reply 2 of 2
    Quote:

    Originally posted by macrules101

    alright.



    I got my new mac and im learnin C++ at school.



    At school we use Apstring.cpp as our string variable.



    1) If apstring is mac compatible where do i put the apstring.cpp and apstring.h files. What folder? Also i want conio.h.



    2) Is there a string variable already included in the compiler. Ive searched around but i dont think so.



    3) Also what is carbon and cocoa. How do i just do c++.



    Thanks




    1. Put it in same directory as the source file you are "including it from" and include it like this: #include "apstring.h", now yo8u can compile from the command line. The conio.h is used in MS products specially DOS based products, I haven´t found it in other Operating Systems (Linux, QNX , OS X), I might be wrong, but you are going to have to find an other way to emulate the functions used in CONIO.H



    2. the string variable included in the compiler is an array of char´s you should be a ble to declare it as char variable_name[]= "the string you want to print";



    3. In the new proyect menu in Project Builder or XCode, select the C++ tool from the selection at the bottom.
Sign In or Register to comment.