Question
This is my code for a project. However I keep getting several errors which I have pasted at the end of the code. If I
This is my code for a project. However I keep getting several errors which I have pasted at the end of the code. If I could get some help figuring out what I need to change, it would be much appreciated.
//Add libraries, namespace, structure and functions #include
//updating kitten bool updateKitten(struct kitten* k, struct roster* r) { int x = findKitten(k->name,r); if(x == -1) { return false; } r -> kittens[x] = *k; return true; } //saves kitten into text file void printToFile(string str, struct roster* r) { ofstream myfile; myfile.open(str.c_str()); myfile size; i++) { myfile kittens[i].name kittens[i].color kittens[i].score size; i++) cout kittens[i].name kittens[i].color kittens[i].score
However, I'm only getting a 7/10 on passing the tests. I keep getting the following errors.
4: Unit test-deleteKitten() 0/10 Test deleting a kitten from roster Compilation failed main.cpp: In function 'bool test Passed (std::ofstream&)': main.cpp:65:28: error: cannot convert roster' to 'roster*' 65 | deleteKitten (kit3.name, kittenRoster); Compilation failed roster main.cpp:12:47: note: initializing argument 2 of 'bool deletekitten (st 12 | bool deletekitten (string name, struct roster* r); 5: Unit test - updateKitten() ^ 0/10 Test updating a kitten cuteness and score in the roster Compilation failed main.cpp: In function "bool test Passed (std::ofstream&)': main.cpp:70:17: error: cannot convert 'kitten' to 'kittent' 70 L updateKitten (update, kittenRoster); Compilation failed kitten main.cpp:15:34: note: initializing argument 1 of "bool updateKitten (k: 15 | bool updateKitten (struct kitten* k, struct roster* r)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started