I was trying to input 5 characters from the keyboard, however my function scans newlines that I did not enter and that are stored in the array I created. I have put some watches, but I can't figure out what I'm doing wrong. Can you help me out please?
Here is part of the code:
#include <stdio.h>
int main(void){
int a, b, l;
int ca[10];
char co[10];
printf("Insert values.\n");
for(a=0; a<5; ++a)
{
scanf("%d", &ca[a]);
}
printf("Insert suits.\n");
for(b=0; b<5; ++b)
{
scanf("%c", &co[b]);
}
}