I want to input a few strings then two integers. Whilst the strings are separated by \'|\', the integers are kept apart by a \'.\'.
Looking around online I have seen s
This seems to work...
#include main() { char x[32] = "abc|def|123.456."; char y[20]; char z[20]; int i =0; int j =0; sscanf(x,"%[^|]|%[^|]|%d.%d.",y,z,&i,&j); fprintf(stdout,"1:%s 2:%s 3:%d 4:%d\n",y,z,i,j); }