exam studying and got stuck.

Hi there!

I'm studying for my exam and I've done an old exam that covers everything we should know for our exam, but I've got a couple of errors and I really didn't know how to solve few problems that i stumbled upon so I did something I'm unsure about is correct/allowed.

If someone could give my code a look and help me out so I can have at least something I know works that I can use as a some kind of reference while studying for the exam.


Cell.h
http://pastebin.com/D8Fc9ZiH

Cell.cpp
http://pastebin.com/FxahYmWU

CellHandler.cpp
http://pastebin.com/HWV7gDZi

Any kind of help will be appreciated!
Best regards.
What is the problem and what are the errors (verbatim please). You can't expect us to compile it for you.
Does it have something to do with you declaring arrays in your function definitions in CellHandler.cpp but passing pointers? Also Cell.h line 61 you seem to have misspelled "Model"
at the moment I only get these two errors.

'showAllTouch' : must return a value
'showDesigns' : must return a value

but that is my biggest concern, I dont know if I'm allowed/able to make those two functions.
The first showAllTouch function should print out all cellphones with touch screen.

showDesign function should let the user type in which design he is interested in (slide, flip, standard) and then it should print out all models with lets say the standard design.

those two functions are my biggest concern atm.
@Computergeek01

hm... I don't think it has anything to do with that, at least not atm.

thats only a cout so not a big problem, but thanks for letting me know.
'showAllTouch' : must return a value
'showDesigns' : must return a value
File and line numbers would have helped. You declared these functions to return int, but you don't set a return value. The caller will see indeterminate values coming back from these functions.

If you don't intend to return a value, you should consider declaring them void instead.
Ok, thanks.
But I don't even know if my function do what I want em to...

now when i return a value or w/e I return i get the following errors.

unresolved external symbol "void __cdecl showDesign(void)" (?showDesign@@YAXXZ) CellHandler.obj

unresolved external symbol "void __cdecl showModelsSorted(class Cell * const,int)" (?showModelsSorted@@YAXQAVCell@@H@Z)

unresolved external symbol "void __cdecl showTouch(void)" (?showTouch@@YAXXZ)
You need to change both the declaration (in the header file) and the implementation (in the source file).
hm..

in the header:
public:
void showTouch();
void showDesign();

is this what you mean?

source file:
1
2
3
4
5
6
7
8
9
void Cell::showTouch()
{
	cout<<this->name;
}

void Cell::showDesign()
{
	cout<<this->name<<" is "<<this->design;
}


this is what I have in my header and in my source file.
Topic archived. No new replies allowed.