Well you seem to have completely mis-understood what character classes are in sscanf.
Try this
Code:
#include <stdio.h>
int main ( ) {
char test[] = "1 yellow car 550.00";
int ncars;
char description[100];
float price;
int scanresult;
scanresult = sscanf( test, "%d %[^0-9] %f", &ncars, description, &price );
if ( scanresult == 3 ) {
printf( "N=%d, Desc=%s, Price=%f\n", ncars, description, price );
} else {
printf( "Bad format\n" );
}
return 0;
}
Basically, it relies on descriptions never having digits, so "2 Mazda MX2 2345.00" would break this code.