C++ Helps Someheader.h: sample result shoudl be: 1A 1A 1B 1A 1B 1B Instructions
ID: 3820911 • Letter: C
Question
C++ Helps
Someheader.h:
sample result shoudl be:
1A
1A
1B
1A
1B
1B
Explanation / Answer
CODE:
Please include the below code in seperate file, say mainfile.cpp
#include <iostream>
#include <vector>
#include "Someheader.h"
using namespace std;
int main(){
vector<A*> myvec;
initVec(myvec);
for (vector<A*>::iterator it = myvec.begin() ; it != myvec.end(); ++it)
std::cout << ' ' << *it;
std::cout << ' ';
}
OUTPUT:
$ g++ mainfile.cpp
$ ./a.out
0x16aac20 0x16aac60 0x16aac40 0x16aac80 0x16aacd0 0x16aad40
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.