samedi 11 juillet 2020

Standard Input -- Using Scanf in place of a Tokenizer

I'm working on a subnetting program that receives an IP Address from a user, and then a Subnet Address thereafter. What I have been doing is using the strtok() function to return char arrays, which I then convert into integers.

However, that requires either an external function and prototype, or lots of extra code taking time I could be spending doing my actually subnetting.

Is it possible to use scanf to recieve user input, and implicitly break it into Tokens according to a specific character delimiter?

Aucun commentaire:

Enregistrer un commentaire