Hi there,
I just got started with learning C. I've having trouble with entering the EOF character to get the desired output. I've tried CTR+Z and CTR+C without any success. The window just closes immediately. The code I'm trying to run is:
#include <stdio.h>
int main(void)
{
int c;
int inspace;
inspace = 0;
while((c = getchar()) != 48)
{
if(c == ' ')
{
if(inspace == 0)
{
inspace = 1;
putchar(c);
}
}
if(c != ' ')
{
inspace = 0;
putchar(c);
}
}
return 0;
}
I'm running Windows 7 64 bit. I use F9 to run the code.
Could you please tell me how to run the above program correctly in Code Blocks? I need that window to stay open NOW!
Thanks for taking the time to read my issue. I appreciate it.