#include <stdio.h>
#include <string.h>
#define N_DIGITS 64
main()
{
char a[N_DIGITS], b[N_DIGITS];
scanf("%s%s", a, b);
if(strncmp(a, b, strlen(a))==0)
puts("yes");
else
puts("no");
return 0;
}
Note that the length of digits is limited by value N_DIGITS
.
The result is as below;
$ ./a.out <<<"123 12345"
yes
$ ./a.out <<<"123 012345"
no