当前位置: 动力学知识库 > 问答 > 编程问答 >

How can I know the version of c?

问题描述:

The "\b" didn't work on my Mac. So i tried to find the reason.

I think that cause of this problem may be the version of c.

Or device could be. If you know it, can you help me?? thank you.

网友答案:

There are three ISO standard versions of C: C90, C99 and C11. To know which C version your program is running check the:

 __STDC_VERSION__

macro.

  • For C90: the macro is undefined.
  • For C99: the macro is defined with value 199901L.
  • For C11: the macro is defined with value 201112L.

On the other hand if what you want to know is the version not of C but the version of your C compiler, as the other answers suggests, run the compiler with the appropriate option (--version for both gcc and clang for example).

Depending on your compiler it can support different C versions. You can ask to change the compiler default C version used for compiling using the -std= option with gcc and clang, for example: -std=c90, -std=c99 or -std=c11.

分享给朋友:
您可能感兴趣的文章:
随机阅读: