PDA

View Full Version : x code question




benlangdon
Mar 6, 2008, 02:44 PM
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



kaltsasa
Mar 6, 2008, 02:48 PM
Dave Mark has a great introduction to Macintosh programming that discusses Xcode among other things.

http://www.spiderworks.com/books/learncmac.php

benlangdon
Mar 6, 2008, 05:04 PM
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++

szymczyk
Mar 7, 2008, 02:46 PM
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.

benlangdon
Mar 7, 2008, 04:36 PM
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.

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:

Cromulent
Mar 7, 2008, 04:52 PM
float varName = 0;

scanf("%f", varName);

sord
Mar 7, 2008, 05:14 PM
Or, using C++ (like specified), just use cin.

benlangdon
Mar 7, 2008, 05:19 PM
float varName = 0;

scanf("%f", varName);
:confused:

Or, using C++ (like specified), just use cin.

where do i put cin:confused:

Cromulent
Mar 7, 2008, 05:35 PM
:confused:



where do i put cin:confused:

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.

benlangdon
Mar 7, 2008, 07:15 PM
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.

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 ...

sord
Mar 7, 2008, 10:24 PM
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 ...
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

benlangdon
Mar 7, 2008, 11:00 PM
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 ;)

macdoobie
Mar 8, 2008, 02:55 AM
Try not to judge your professors just for that. I had a not to mention it doesn't look like you can write English very well either

lolol:D:D

Willis
Mar 8, 2008, 08:29 PM
why use c++ when surely it would be more straight forward to use Obj-C...

benlangdon
Mar 8, 2008, 09:03 PM
why use c++ when surely it would be more straight forward to use Obj-C...

its for my class...;)