|Dec 8, 2012, 04:04 AM||#1|
Xcode 4.5.2 - Execution stops after CIN input
I am very new to programming, especially in C++ so I am sorry if I suck at describing the problem.
I am currently trying to run a programme to just simply input a value and output the value again.
I've researched on google and there seems to be a problem with the preprocessors of the debugger in earlier versions. However I couldn't find any of these settings in my Xcode.
The problem seems similar to this, however the solutions don't resolve my problem and I also don't have any of the macros (or at least can't find them).
Does somebody know what to do here?
Lastly, please try and explain it step by step, so that I can follow it. :-)
|Dec 8, 2012, 06:48 AM||#2|
I can confirm that the code works as written although it might want an endl:
$ g++ mactest.c -o mactest
Please enter length: 45
Please enter length: 12
|Dec 8, 2012, 01:02 PM||#4|
Instead of using Xcode he compiled and ran your code within the Terminal from the Command Line Interface, also known as the CLI.
Terminal.app can be found in /Applications/Utilities
In order to follow the example above lets assume the existence of a folder named 'FunStuff' on your Desktop that contains the source file 'mactest.c'.
First issue the command -
from the CLI.
This will set the current working directory to be within the specified directory. You can now reproduce his result following the commands issued in his example.
Last edited by lloyddean; Dec 8, 2012 at 06:48 PM.
|Dec 8, 2012, 01:24 PM||#6|
At the top right of the window above the "source" pane is a collection of buttons. One of which is called "View". Select the center button. A "debug" pane should appear below your projects source.
The resulting view, below the source view, should be split into multiple view panels one of which should be "Console" output and input. If the console subview is not showing click on the middle of the three grouped buttons to the right of the "Clear" button and it should appear. This is where you see you programs output and where you type your responses.
Last edited by lloyddean; Dec 8, 2012 at 06:55 PM.
|Thread Tools||Search this Thread|
All times are GMT -5. The time now is 09:47 PM.