Inline function and & Operator in C++ -
what function ?
inline bool myfunc(int aval) {return aval & 1;}
edit have edited code runnable.
keyword inline
shall written lower case letters.
inline bool myfunc(int aval) {return aval & 1;}
the function returns true
if first bit of value aval set 1. otherwise returns false
.
using function can check illustration whether aval odd or number. :) if function homecoming true
means number odd.
the operator & bitwise , operator.
c++
No comments:
Post a Comment