Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Brug af scanf_s #11

Closed
audio-engineer opened this issue Oct 17, 2023 · 1 comment
Closed

Brug af scanf_s #11

audio-engineer opened this issue Oct 17, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@audio-engineer
Copy link
Owner

audio-engineer commented Oct 17, 2023

@Danar435 Funktionen scanf_s findes kun på Windows, men ingen andre platformer. Derfor kan fx jeg ikke køre dit program på macOS.

image
https://github.com/audio-engineer/exercises/blob/e43fb7723ff4116d078493233267f37faf7b2de6/4_6/4_6_k/src/main.c#L9

Du kan løse problemet ved at gøre koden cross-platform ved at enten bruge fgets funktionen eller bruge platform macros. Læs evt. https://stackoverflow.com/questions/4605842/how-to-identify-platform-compiler-from-preprocessor-macros,
https://stackoverflow.com/questions/430424/are-there-any-macros-to-determine-if-my-code-is-being-compiled-to-windows og
https://github.com/cpredef/predef/tree/master

@audio-engineer audio-engineer added the bug Something isn't working label Oct 17, 2023
@Danar435
Copy link
Collaborator

I'm aware, det fikser jeg senere

@audio-engineer audio-engineer closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants