0
A Get functionâs inverse
For my code, I have two functions, âget_no_of_studentsâ, and âadd_studentâ. How would I go about creating a âdrop_studentâ function that removes a student that I have added? https://code.sololearn.com/cCIDeBB1cZCE/#cpp This is the code for my cpp file, i will link the header as well edit: https://code.sololearn.com/c6g42qUYhbCA/#cpp
4 Respostas
+ 4
That would depend somewhat on how you implemented the other functions (or class with methods).
Care to share your code? You can upload it in Code Playground and link it here.
+ 1
https://code.sololearn.com/cCIDeBB1cZCE/#cpp
This is the code for my cpp file, i will link the header as well
edit: https://code.sololearn.com/c6g42qUYhbCA/#cpp
+ 1
You would need to iteratorate through the array of student names, checking to find a matching name.
If found you can remove It be moving all the following names down one slot in your array. If order doesn't matter, then you can just assign the last name to the this slot.
Then decrease the number of students by one.
0
thanks so much đđœ Jared Bird