When working with the enum type in C++, is the point just so your string literals give meaningful names? because it doesnt operate like an array, meaning i cant do function method takes the int index of an enum and hten print the string
tmp/cccttnc9.o: In function `main': birthdayInfo.cpp:(.text+0x1dc): undefined reference to `Person::setName(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
I've learned to leave them alone too... ever since I force-installed a package on an Ubuntu install - and it corrupted the package DB so bad that I had to reinstall pretty much every package on the system.
Let me get the basics of C++ down and i'll consider it :)
right now i'm happy being a VB/C#/PHP developer, and C++ for school. I thought about picking up Python, but C++ may be the route i go instead for the short-term since I'll have a few months of schooling in it.
string Person::getBirthStone(int month) { switch (month) case Garnet: return "Garnet"; case Amethyst: return "Amethyst"; case Aquamarine: return "Aquamarine"; case Diamond: return "Diamond"; }
was that along the lines of what you were getting at?
shit the criteria was enum of months but thats a quick fix
@GeorgeEdison defining that enum, i should be able to pass it in as a parameter of the prototyped class method correct? string Person::getBirthStone(Months month) correct?
says on line 40 of person.cp: /home/charles/Dropbox/School/CeePlusPlus/BirthdayProfile-build-desktop/../BirthdayProfile/person.cpp:40: error: ‘std::string Person::getBirthStone’ is not a static member of ‘class Person’
/home/charles/Dropbox/School/CeePlusPlus/BirthdayProfile-build-desktop/../BirthdayProfile/person.cpp:40: error: ‘Months’ was not declared in this scope
does not compute as to why its not valid in my brain
its declared as public in the class, and htis is the class body
/home/charles/Dropbox/School/CeePlusPlus/BirthdayProfile-build-desktop/../BirthdayProfile/person.cpp:40: error: ‘std::string Person::getBirthStone’ is not a static member of ‘class Person’
/home/charles/Dropbox/School/CeePlusPlus/BirthdayProfile-build-desktop/../BirthdayProfile/person.cpp:40: error: ‘Months’ is not a member of ‘Person’
/home/charles/Dropbox/School/CeePlusPlus/BirthdayProfile-build-desktop/../BirthdayProfile/person.cpp:40: error: ‘std::string Person::getBirthStone’ is not a static member of ‘class Person’
/home/charles/Dropbox/School/CeePlusPlus/BirthdayProfile-build-desktop/../BirthdayProfile/person.cpp:40: error: ‘Months’ is not a member of ‘Person’
/home/charles/Dropbox/School/CeePlusPlus/BirthdayProfile-build-desktop/../BirthdayProfile/person.cpp:41: error: expected ‘,’ or ‘;’ before ‘{’ token
it was sitting in limbo during the failed build. i saw the debug screen, and it did nothing. i made changes and apparently after cleaning the build it erased my source changes.
i understand what i was trying to do now that i've failed at it horibly four or five times and now i have a working, and compiling project thats doing what i tell it to