Hacker News new | past | comments | ask | show | jobs | submit login

A lot of the C99 features like array initialization got sucked into C++11, and since the C "compiler" in MSVC is the C++ compiler, I think you'll probably get most of C99 for free.



If only that were true - however, some of the more interesting C99 and C11 features aren't part of C++11 as there are already C++ specific alternatives.

Also, MS doesn't really have a good track record of backporting C++ features to C (mixing code and declarations, anyone?).

If you want to write portable C code that works on at least *nix and Windows, either ignore MSVC (GCC works just fine on Windows via MinGW or Cygwin cross-compiler, as does Clang once you get it set up), or restrict yourself to the common subset of C99 and C++98...


One thing I'm pretty jealous of is "Designated initialization" in C99:

    int whitespace[256]
        = { [' '] = 1, ['\t'] = 1, ['\h'] = 1,
            ['\f'] = 1, ['\n'] = 1, ['\r'] = 1 };
Very cool.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: