I want to get input from the user 1234 and when i press in the 4 digit to finish the scanf I tried
int num = 0;
scanf("%4d",&num);
getchar()
printf("%d",num);
but it stopped only when I press enter and get the 4 first numbers , I don't want to press on enter I want to finish the input on the 4 digit and to get the number in num. also is it possible to get the 4 numbers to 4 different variables
int num = 0;
int num2 = 0;
int num3 = 0;
int num4 = 0;
scanf("%d%d%d%D",&num,&num2,&num3,&num4);
getchar()
but it didn't work also I can change the function of scanf to something else