3. in the processor area you might also find prototypes. such as: void ouch ();
ID: 645365 • Letter: 3
Question
3. in the processor area you might also find prototypes. such as:
void ouch ();
void ouch (int b, short e);
a) explain why prototypes are necessary and what they do.
b) explain what each of the commands above do.
2b. Explain what each of the commands above do (5 pts/command) 3. in the processor area you might also find prototypes. such as: void ouch (); void ouch (int b, short e); a) explain why prototypes are necessary and what they do. b) explain what each of the commands above do. 2. Given the following preprocessor area commands: 2a. Explain what preprocessor area is intended to do (10 pts)Explanation / Answer
1. # include "stdafx.h" :
Advantages :
2. # include <iostream.h>
3. using namespace std :
Ex:
Ex:
Output :
Ex: using namespace std;
cout<<"HI";
Ex: std::cout<<"HI";
#include <iostream> using namespace std; namespace a { int x = 1; int y = 12; } namespace b { double x = 3.1416; double y = 2.7183; } int main () { cout <<a::x << ' '; cout << a::y << ' '; cout << a::y << ' '; cout << second::x << ' '; return 0; } Output :
2 12 3.1416 2.7183
- All the variables, constants, and functions of the standard C++ Library are declared within the std namespace.
Ex: using namespace std;
cout<<"HI";
- If we did not declared the std namespace, we need to define every time when we need to initialize the function.
Ex: std::cout<<"HI";
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.