ccplusplus.com
Learn C, C++ Concepts
Sunday, March 25, 2012
using #error in c
/******************************************************************* * File : hash-error.c * Author : saurabhgupta * Description : using #error in c * Date revised : PM 01:07 25 March 2012 * Source : http://www.ccplusplus.com/p/c.html * Note : *******************************************************************/ #include
//#define CCPLUSPLUS "ccplusplus" int main () { #ifndef CCPLUSPLUS #error ccplusplus is required #endif return 0; } /* * OUTPUT, you will get the compilation error here as ccplusplus we have not defined * [sgupta@rhel6x64 c]$ gcc -o hash-error hash-error.c hash-error.c:15:10: error: #error ccplusplus is required [sgupta@rhel6x64 c]$ */
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment