DeVry GSP125 Week 6 Discussion 1 & 2 latest 2016

dq 1Static Class Members (Graded)What special property does a static class member have? Is it shared among all objects of that class?What is the difference between a public static variable and a global variable?What is an exception? What are exceptions for?dq 2Inline Functions (Graded)What are inline functions designed to do? Discuss the difference between inline functions and regular functions.What is apreprocessor macro? Give an example.Consider the following code.#include
usingnamespace std;
#include
inlineint addFunction(intconst& a,intconst& b)
{
return a+b;
}
#define addMacro(a, b)(a+b)
void main()
{
int sum;
sum= addFunction(5,12);
cout<< sum<< endl; sum= addMacro(5,12); cout<< sum<< endl; return0;}What is the difference between addFunction and addMacro? What is the difference in the compiler output?

Order Solution Now

Similar Posts