64 693
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #31786 in C++ for Jay

Question #31786
Add a member function
Void Employee::format(char buffer[], int buffer_maxlength
to the Employee class. The member function should fill the buffer with the name and salary of the employee. Be sure not to overrun the buffer. It can hold buffer_maxlength characters, not including the’\0’ terminator. (That is, the buffer has buffer_maxlength + 1 bytes available.) Be sure to provide a ‘\0’.
Expert's answer
void& Employee::format(char buffer[], int buffer_maxlength)
{
char *wch = new char;

wch[buffer_maxlength];

cin>>wch;

for(int i=0; i<buffer_maxlength-1; ++i)
{
buffer[i]=wch[i];
}

delete wch;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions