/srv/irclogs.ubuntu.com/2013/09/09/#ubuntu-my.txt

faizulhi09:08
faizulhi hyperair 09:24
hyperairhi09:24
excalibrhyperair: o/13:23
excalibrhow do you print out the date_string var in this code13:24
excalibrhttps://github.com/GNOME/gnote/blob/master/src/test/dttest.cpp#L7113:24
angchcout << date_string // ??13:25
excalibrwhy cannot use printf13:27
excalibrtest/dttest.cpp:82:97: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘std::string {aka std::basic_string<char>}’ [-Wformat]13:27
excalibri wrote printf ("bablabla %s \n", date_string);13:27
angchbecause std::string is not char * ...?13:29
angchunicode and all that.13:29
excalibrahh sorry :P13:33
hyperairexcalibr: \o14:58
hyperairstd::string has a different memory representation than a char*14:58
hyperairif you try to printf an std::string, things will go wrong. very horribly14:58
angchwell, there's always sprintf("%s", date_string.c_str()); // Hackity hack. C++ is not C, stop mixing and matching me!15:07
angchhttp://www.cplusplus.com/reference/string/string/c_str/15:07
angchsorry, snprintf, etc, etc.15:08
angchrusty15:08

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!