Skip to content

Add sscanf #552

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

Open
ZERICO2005 opened this issue Mar 13, 2025 · 5 comments
Open

Add sscanf #552

ZERICO2005 opened this issue Mar 13, 2025 · 5 comments

Comments

@ZERICO2005
Copy link
Contributor

ZERICO2005 commented Mar 13, 2025

Not sure how scanf or fscanf would work on the CE, but it would be nice to add sscanf and vsscanf to the toolchain.

int sscanf(const char *__restrict buffer, const char *__restrict format, ...);
int vsscanf(const char *__restrict buffer, const char *__restrict format, va_list va);
@BlueCannonBall
Copy link

scanf could work the same way printf does.

@mateoconlechuga
Copy link
Member

Wat

@adriweb
Copy link
Member

adriweb commented Apr 6, 2025

scanf implies having an stdin, which we don't have. You can always get user input some other way that's more native to the specific platform.

At least the other ones mentioned in the top post are "standalone".

@BlueCannonBall
Copy link

scanf implies having an stdin, which we don't have.

And printf implies having an stdout, which the CE doesn't really have either. That didn't stop printf from being implemented.

@adriweb
Copy link
Member

adriweb commented Apr 6, 2025

Except we have the LCD as the output and a whole section in the doc about printf, puts etc.
On the contrary, something that gets close (but not really) to stdin is os_GetStringInput, which is not recommended to use anyway.

So no, it's not comparable. If someone wants to have scanf based on a non-recommended function, they can always make their own in their program.

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

No branches or pull requests

4 participants