How to use <Windows.h>

Question:
Anyone know how to use Windows.h in C? I need it in a project but it says can’t find

#include <Windows.h>

Plz help

Windows.h is a Windows header file. Repls are run on Replit’s machines which are all Linux, not Windows, so I don’t believe you can use it in a Repl.

3 Likes

Actually, using the following method you can use it on either Linux or Windows!

#ifdef _WIN32
#include <Windows.h>
#else
#include <unistd.h>
#endif

@TaokyleYT

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.