The description of the string format is not entirely clear, but I think I can answer your question anyway (extracting integers with letters and adding (?) Them to the corresponding int variable).
So starting from this line:
char * was = "3e, 6s, 1d, 3g, 22r, 7c"; // was == weird ass string
probably the easiest way to use it is using strtok .
char* token = strtok (was,",");
while (token != NULL) {
assign(token);
token = strtok (NULL, ",");
}
sscanf, .
void assign(char* token) {
char letter;
int number;
if (0 != sscanf(token, "%d%c", number, letter)) {
} else {
}
}
( (?)), . , , , .
, , , sscanf.