Re: gcc oriented questions
- From: Skip Montanaro <skip pobox com>
- To: David Robin <david robin st com>
- Cc: gtk-list gnome org
- Subject: Re: gcc oriented questions
- Date: Wed, 8 Aug 2001 11:37:33 -0500
David> - why are callback functions defined as 'static'? Is there an
David> obligation to do so? Does it makes my app faster?
You rarely need your callback functions exposed to the outside world, so
declaring them static keeps them from cluttering up your external symbol
table. This can be especially useful if you are building a library that
will be linked into other programs, because it helps avoid name clashes.
David> - can a C++/GTK+ app be as performant as its C/GTK+ counterpart?
David> If C is faster, is there a program that would translate my C++
David> sources to C (eg. class -> struct etc.)?
I wouldn't think that a C++ app that uses Gtk would typically be any slower
than a C version, though I suppose it depends on how much of C++'s various
features you use. To at least a first approximation a C++ class is the same
as a C++ struct anyway. It's just that the default visibility of its
members is private instead of static. I wouldn't worry about it.
--
Skip Montanaro (skip pobox com)
http://www.mojam.com/
http://www.musi-cal.com/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]