0

As I typed that title, it became more and more clear to me that it was confusing.

Ok, I'm writing a C program for school using Xcode. When I build/run it from within Xcode, it won't allow me to enter double digit integers as input and I can't figure out why. If I run the built executable which is stored in the 'products' folder of my project, it opens in its own terminal instance and WILL accept my input correctly. Why is the built in environment not allowing this? (is that what its technically called?)

here is a snip of the code I am talking about:

void getScores()
{
    int score1;
    int score2;
    int score3;
    char grade;
    printf("\nEnter three test scores 0-100 with a <space> in between then press enter :
    ");
    scanf("%d %d %d", &score1, &score2, &score3);
    grade = getGrade(score1, score2, score3);
    printResults(grade);
    return;
}//getScores
vertigoat
  • 57
  • 1
  • 6
  • What built-in console are you referring to? – trojanfoe Oct 03 '12 at 10:57
  • There is a similar question here: http://stackoverflow.com/questions/12635860/xcode-4-5-character-not-show-in-console-box-with-scanf-in-c-language. It seems that this is a bug of Xcode 4.5. – deltheil Oct 03 '12 at 13:04

1 Answers1

0

Got the same problem. It seems Apple is working on that.
Running the exec file in the Terminal is the simplest way to run your program. However, it is possible to display your input in the built-in console. You must type your digits (only the first of them will be displayed), then select another output in the drop-down menu and select "Target output" again.

Hope it will be solved soon.

Sumit Singh
  • 15,743
  • 6
  • 59
  • 89