Hi, I'm wondering why this little program I wrote works on my freeware Pacific C MS-DOS compiler, but it doesn't quite work right on my Dev-C++ for win32 by Bloodshed, also freeware.

Code:
#include <stdio.h>


int main() {
                  char string[10];      
                  printf("Enter a string:");
                  scanf("%s", string); 
                                                  
    for (counter = 0; counter < 10; counter++) {
                                  if (string[counter] == 'k') {
                                     printf("You typed a k!");
                                   }
                                   }
                                   getchar();
return 0;
}
Everything works fine except the getchar(); when I compile it under Dev-C++. I even tried including conio.h instead of just the regular stdio.h....in the other compiler it compiles just fine with just stdio, I even looked in it, and getchar is in there. Now here's the really weird part, I tried moving the getchar command up to right above printf, just to see if it would work in another part of the program, and it did....what on earth is going on here???

Thanks in advance, Ash