can someone tell me what the heck is with getchar? it skips over the getchars and its REALLY annoying. also, should i use scanf to hold screen?? i was using getchar until all the time until i started using it for input aswell, then this error started happening



i just copy pasted a bunch of headers cause i was lazy and whipped this up fast, dont try running it without looking at the code.



#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int main()
{
int bob,fred,joe, hold;
char c;

printf("enter bob\n");
scanf("%d", &bob);
printf("paused\n");
getchar(); /*why does it skip?*/
printf("enter fred\n");
scanf("%d", &fred);
printf("paused\n");
getchar(); /*why does it skip?*/
printf("enter joe\n");
scanf("%d", &joe);
printf("paused\n");
getchar(); /*why does it skip?*/
printf("bob %d fred %d joe %d\n",bob,fred,joe);
getchar(); /*why DOESN'T it skip?*/

printf("Problem child 2\n");
c = getchar();
printf("%c \n", c);
getchar(); /*why does it skip second getchar*/

printf("Problem child 3\n");
scanf("%d", &bob);
scanf("%d", &fred);
scanf("%d", &joe);
printf("bob %d fred %d joe %d\n",bob,fred,joe);
scanf("%d",hold);

return 0;
}