Yuri Albuquerque
Yuri Albuquerque

Reputation: 504

Does mingw do some posix implementations?

I installed mingw on linux and tried compiling a code for windows, this code is intended for posix systems, because I use the% m converter, but realize that when using the _POSIX_C_SOURCE 200112L macro, I can use the converter, so mingw provides a library C that supports the posix pattern?

#define _POSIX_C_SOURCE 200112L
#include <stdio.h>

int main(void){
    char *a;  
    scanf("%ms", &a);
    puts(a);
    return 0;
}

Upvotes: 1

Views: 1038

Answers (1)

S.S. Anne
S.S. Anne

Reputation: 15576

MinGW supports a subset of POSIX-like features (%ms, alarm, signal, etc.) on top of MSVCRT, but it's not POSIX-compliant. If you need a POSIX-compliant environment on Windows, use Cygwin.

Upvotes: 3

Related Questions