Re: Get gchar* from Glib::ustring
- From: Mark Roberts <gtkmm manumark de>
- To: Fabrício Godoy <skarllot gmail com>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Get gchar* from Glib::ustring
- Date: Thu, 4 Jun 2009 10:05:21 +0200 (CEST)
Dear Fabrício,
> > > And note that because the argument is untyped (it is an elipsis
> > > argument) you cannot use the normal C++ 0 as a synonym for NULL.
> > An explicit cast of 0 to pointer type is in fact the only safe way.
> Well, I'm somewhat confused. Should I use "static_cast<void*>(0)"?
> Each item is not char (16 bit)?
Your arguments to g_build_filename() are pointers to characters. On a
32bit system a pointer is 32bit, on a 64bit system it is 64bit. "NULL" is
a pointer to anything (therefore also 64bit on a 64bit system), while "0"
is an integer, which might be 32bit on a 64bit system. Or it might not be.
If you know what "static_cast<void*>(0)" means, then use it and feel
clever. If you don't, use "((void*)0)" and feel practical.
Good luck!
Mark
---------------------------------------------------------------
Mark Roberts, hardcore C++-Programmierer, Musiker, Schauspieler
05121 511455
www.rapid-arts-movement.de
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]