How to determine whether a compiler supports wide character or not

Discussion in 'C Programming' started by Ashabul Yeameen, Sep 16, 2003.

  1. I am writing a program which at some point need to call fputwc()
    function. But since I want to make this code portable I've decided to
    write my own fputwc() funcion where the compiler doesn't supply this
    funcion. But how to determine whether the compiler supports wide
    character or not (depending on which my funcion will compile). Is
    there any preprocessor directive?

    thanks in advance

    Ashabul Yeameen, Sep 16, 2003
    1. Advertisements

  2. Ashabul Yeameen

    Mike Wahler Guest

    #include <stddef.h>

    int main()
    wchar_t wc;
    return 0;

    If it compiles, your implementation supports wide characters.

    Mike Wahler, Sep 16, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.