Behavior is very inconsistent-- very frustrating.
The problem must lie in pasting some input text into Xcode's Debug Area.
Here's how to replicate the problem:
#include <stdio.h>
/* count digits, white space, others */
main() {
int c, i, nwhite, nother;
int ndigit[10];
nwhite = nother = 0;
for (i = 0; i < 10; ++i)
ndigit[i] = 0;
while ((c = getchar()) != EOF)
if (c >= '0' && c <= '9')
++ndigit[c-'0'];
else if (c==' '||c=='\n'||c=='\t')
++nwhite;
else
++nother;
printf("digits =");
for (i = 0; i < 10; i++)
printf(" %d", ndigit[i]);
printf(", white space = %d, other = %d\n", nwhite, nother);
}
- Run this C code in Xcode
- Paste in some Lorem Ipsum into Xcode Debugger Area
- ⌃d will not send EOF signal
Doesn't work even if you send Ctrl-d on its own line.
Note** Works fine (pasting in lipsum and signaling EOF with ⌃d) when you run the compiled executable from Terminal. Also, Ctrl-d doesn't need to be on its own line (just keystroked twice in a row). Still works regardless.