![]() |
| ||
| Class Movie...error undeclared identifier #include <iostream>I am trying to create a class movie. When i enter in the Movie a,b,etc. it gives me the error undeclared identifier. I don't understand this error i was under the impression that by syntaxing it in that way it would call upon the constructor and enter it as that. any help? |
| ||
| Re: Class Movie...error undeclared identifier also i know all my definitions are outside of the class it was a requirement |
| ||
| Re: Class Movie...error undeclared identifier An identifier and a string are different because a string is surrounded by double-quotes. Movie a(Formatted for readability... Have fun! |
| ||
| Re: Class Movie...error undeclared identifier thank you very much i knew i was just missing something...its been 2 years since i have had c++ |
| ||
| Re: Class Movie...error undeclared identifier string Movie::show(){is it possible to bring these three into one operation...i guess my real question is "is it possible to return more than one value and if yes then more than one value of more than one type?" |
| ||
| Re: Class Movie...error undeclared identifier Yes. The easiest way would be to use reference parameters. void Movie::getstuff( std::string &name, int &hours, int &minutes ) {Then you would call it like std::string title; That said, the better way is to keep it separate like you have it. std::cout << '"' << a.getTitle() << "\" has a runtime of " Good luck. |
| All times are GMT -4. The time now is 10:17 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC