Originally Posted by CommonTater Code: sscanf(string," %s:%d",str,&num); This is also a wrong solution and will never work. A working solution is Code: if( 1==sscanf("rows: 3","%*[^:]:%d",&intvar) ) { /* have fun */ } else { /* bad input */ }
sscanf(string," %s:%d",str,&num);
if( 1==sscanf("rows: 3","%*[^:]:%d",&intvar) ) { /* have fun */ } else { /* bad input */ }
View Tag Cloud