The macro are just symbolic representations and cannot contain data type differentiations within the parameters that we give. The in line functions can have the data types too defined as a part of them. The disadvantage in using both is that the inclusion of condition checks may lead to increase in code space if the function is called many times.
If n is the given number, then the expression (n & (n-1)) = 0 gives the logical output depicting if it is a power of 2 or not, if (n & (n-1) == 0) printf (“The given number is a power of 2”);
The semaphore is an abstract data store that is used to control resource accesses across the various threads of execution or across different processes. There are two types of semaphores: • The binary semaphore which can take only 0,1 values. (used when there is contention for a single resource entity) • The counting semaphore which […]