C/C++ >> strings and char *
Posted by MoX on 20:24:00 02-22-2002
Hey there!

I'm trying out gtkmm for some time now but I got stuck using the Gtk::text widget.
I could only obtain the text in the widget as a string (yeah, a string as defined in the standard-library NOT a char *).

Anyway, I can't handle those strings and I even don't want to right now. Does anybody here know a way to convert the string to a normal char *?
Posted by SilentStrike on 21:46:00 02-22-2002
std::string easyToUseAndNotNearlyAsErrorProne = "blah";
char* painToUseCstyleString = easyToUseAndNotNearlyAsErrorProne.c_str();

Is that what you want?

[ This Message was edited by: SilentStrike on 2002-02-22 21:46 ]
Posted by MoX on 02:34:00 02-23-2002
WTF?
Posted by MoX on 02:34:00 02-23-2002
WTF?
Posted by MoX on 11:28:00 02-23-2002
Hm, you're right. That'll work. I'll have a closer look at std::string soon.

Thanx a lot!
Posted by KaGez on 13:44:00 02-27-2002
just use GTK+ and all your problems will go away
[addsig]
Posted by MoX on 15:43:00 02-27-2002
Hmm...Gtkmm is a lot better than Gtk+. Also I'm writing the rest of my prog in C++ and I prefer doing the whole thing in the same style.
Posted by KaGez on 09:11:00 02-28-2002
ok, plz don't say thing like "gtkmm is better", because it will lead into major flamewars. It's a matter of taste, and if you like to code in C or C++.

[addsig]