Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Words #8

Open
Crayder opened this issue Nov 25, 2016 · 4 comments
Open

Suggestion: Words #8

Crayder opened this issue Nov 25, 2016 · 4 comments

Comments

@Crayder
Copy link

Crayder commented Nov 25, 2016

Simply put, a word specifier ('w'). It will take everything up to a space or custom delimiter. It's basically like the string specifier when there are parameters after it but takes a specified amount of words.

Format: w<word count>[string size]

sscanf("bleh bleh teh faq yuu mein", "w<2>[24]w<4>[48]", words1, words2);
words1 will be "bleh bleh", words2 will be "teh faq yuu mein"

@Konstantinos-Sk
Copy link

Konstantinos-Sk commented Nov 25, 2016

I get it that it would make it simpler but as long as string arrays exist, I don't really see a point:

new words1[2][12], words2[4][12];
sscanf("bleh bleh teh faq yuu mein", "a<s[12]>[2]a<s[12]>[4]", words1, words2);

It's not that we cannot "join" those words with a space or custom delimiter and make it work.

@Crayder
Copy link
Author

Crayder commented Nov 25, 2016

I get it that it would make it simpler but as long as string arrays exist, I don't really see a point:

It's not that we cannot "join" those words with a space or custom delimiter and make it work.

You just contradicted your self like three times in the same comment.

Yes, simpler is the point. An array of strings is much more complicated than a few words in one string.

Storing them in an array and joining them is part of the work the sccanf plugin was built to relief!

@JustMe77
Copy link

I agree with Crayder here, it would be simpler, so why it's not implanted yet :p

@Y-Less
Copy link
Owner

Y-Less commented Mar 28, 2022

This is a good idea. Ignore the merge comment above, that's a result of combining two different repos in to one giving conflicting IDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants