Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: C++
Expertise: All
Jun 16, 2000



Application Security Testing: An Integral Part of DevOps

Making Inline Functions Compatible With C Compilers

A global function may be declared inline. If you use the same function in different development environments, e.g., C and C++, you can hide the "inline" keyword from a C compiler while keeping it visible to a C++ compiler like this:

#ifndef __cplusplus
#define inline

The preprocessor directives make sure that only a C++ compiler sees the inline keyword:

inline int get_dst() {return dst; }// inline not seen by C
Danny Kalev
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date