View Single Post
Old 06-27-2005, 09:08 PM   #1 (permalink)
Aniviel833
Registered User
 
Join Date: Jun 2005
Posts: 26
Aniviel833 is on a distinguished road
using a string in a class

Thankies to Valmont for being so helpful in fixing the problem that has led me to this problem!

Now that I know how to use and create header files, have got everything linking correctly, and figured out this #ifndef stuff, I'd like to....use a string as a variable type in one of my classes.

So-oo, how do I do this? I've sort of been skirting my string issues for awhile now. I don't really understand anything about the 'using namespace std;' statement, which is the only way I've been getting strings to work. Now that I've got my class seperated into a .h and .cpp file, I don't know where I would put it, either.

I've tried putting it in various places and messing around alot but I keep getting lots of "'string' used as a type, but not defined as a type" errors.

Can someone guide me through using a string as a var type in a class? Thanks.
Aniviel833 is offline   Reply With Quote