Standard I/O
Functions: scanf
, prinf
, getchar
Issues
Scanf multiple char
#include `<stdio.h>`
#include `<stdlib.h>`
int main(){
char c1, c2;
scanf("%d", &c1);
scanf("%d", &c2); // is skipped !
}
Resolve: use getchar()
Functions: scanf
, prinf
, getchar
#include `<stdio.h>`
#include `<stdlib.h>`
int main(){
char c1, c2;
scanf("%d", &c1);
scanf("%d", &c2); // is skipped !
}
Resolve: use getchar()