티스토리 뷰

Piece

[C/C++] Predefined Macros

More Code 2018. 6. 30. 09:19

[MSC] Predefined Macros


[GCC] Predefined Macros



#include <iostream>
using namespace std;

int main()
{
// Standard Predefined Macros
cout << "File: " << __FILE__ << endl;
cout << "Line: " << __LINE__ << endl;
cout << "Func: " << __func__ << endl;
cout << "Date: " << __DATE__ << endl;
cout << "Time: " << __TIME__ << endl;

// MSC Specific Predefined Macros
int majorNumber = (_MSC_VER) / 100;
int minorNumber = (_MSC_VER) % 100;
int buildNumber = (_MSC_FULL_VER) % 100000;
printf("MSC Version: %d.%d.%d\n", majorNumber, minorNumber, buildNumber);

// GCC Specific Predefined Macros
printf("GCC Version: %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);

return 0;
}


공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함