Thread: C++ Arrays
View Single Post
Old 11-09-2006, 02:51 PM   #12 (permalink)
punt59
Forum Newbie
 
Join Date: Nov 2002
Posts: 89
Default

If I understand you correctly, you want to initliaze a class with a string?

Code:
#include <string>
class Class1
{
public:
     Class1(const std::string &="")

public:
    std::string s;
};
And the implementation

Code:
Class1::Class1(const std::string &var)
{
    s= var;
}
punt59 is offline   Reply With Quote