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’.
1
Expert's answer
2013-06-11T08:02:11-0400
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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS