View the step-by-step solution to:

show me how to write the code easier template<int n,typename b_type=unsigned int,typename l_type=unsigned long long,long_type base=bases(DEC)> class...

show me how to write the code easier


template<int n,typename b_type=unsigned int,typename l_type=unsigned long long,long_type base=bases(DEC)>

class NSizeN

{

public:

int a_size = 0;

vector <b_type> place_number_vector; // number stored in the vector

NSizeN(int a){ //constructor

do {

place_number_vector.push_back(a % base);

a /= base;

a_size ++;

} while(a != 0);

}

void output(ostream& out, NSizeN& y)

{

for(int i=a_size - 1;i >= 0;i--)

{

cout << (l_type)place_number_vector[i] << ":";

}

}

friend ostream &operator<<(ostream& out, NSizeN& y)

{

y.output(out, y);

return out << endl;

}

}

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question