I have 2 questions.
Here in the C++ reference
#include <stdio.h>
int main ()
{
char sentence []="Rudolph is 12 years old";
char str [20];
int i;
sscanf (sentence,"%s %*s %d",str,&i); <---
printf ("%s -> %d\n",str,i);
return 0;
}
Question 1. What exactly is %*s doing?
My program I'm building a hash table.
It queries the user to either type in
q- quit
i <int> - inserts integer //must be on same line
d <int> - deletes integer //must be on same line
etc....
For example:
in order to insert "35" I would have to type:
i 35
Question 2. Would the C++ reference work for both 'q' and 'i 35' since 'q' has no integer with it?
char choice[10];
char option;
int i;
sscanf(choice, "%c %d", &option, &i);
Would this work if 'q' was entered(no integer attached) as well as if "i 35" was entered (w/integer attached)?