problem in source code

When executing the source code in C++, it doesn't show the first line, trying to enter again it still remain same problem. Any idea?

when I run the program does not show what I write and I have to press the enter to go to the next line and then show me the cursor to write

i have Version 10.1 (10B61)

Accepted Reply

What sort of project are you working on? Specifically, when you started your project, what template did you choose in the File > New > Project UI?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

What sort of project are you working on? Specifically, when you started your project, what template did you choose in the File > New > Project UI?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

when a run the program in a terminal box don't show the first input when a type .

if a click enter and change line then a type now show the ''number'' but the first input is take it but not show

File > New > Playground

File > New > Playground

Right. That then presents a template chooser where you can choose from a variety of templates. Which did you choose?

Oh, but wait, earlier you mentioned C++. Are you trying to run C++ code in a playground? That’s going to… challenging. Playgrounds only support Swift.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

NOTE!!

************this program in Dev-C++ is compile but in Xcode don't run*********


#include <iostream>

using namespace std;

int binary_search (double arr[], int N, double target) {

int first = 0, last = N - 1, mid;

while (first <= last) {

mid = (first + last) / 2;

if (arr[mid] == target)

return mid;

else if (target < arr[mid])

last = mid - 1;

first = mid + 1; }

return -1;}

int main() {

int N;

cin >> N;

double numbers[N], item;

for (int i=0; i<N; i++)

cin >> numbers[i];

cin >> item;

cout << binary_search (numbers, N, item) << endl;

return 0; }