Date: Sun, 20 Feb 2005 16:15:43 +0100 From: "Daniel S. Haischt" <me@daniel.stefan.haischt.name> To: Gert Cuykens <gert.cuykens@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: c++ Message-ID: <4218A99F.4080204@daniel.stefan.haischt.name> In-Reply-To: <20050220124749.GA523@tuatara.fishballoon.org> References: <ef60af09050219015116024f83@mail.gmail.com> <5b8472dd5925a0b0b59f15cd9f8e15f3@shire.net> <ef60af0905021915074e5d2929@mail.gmail.com> <675354920.20050220001731@wanadoo.fr> <ef60af0905021923411a0272b6@mail.gmail.com> <20050220124749.GA523@tuatara.fishballoon.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Gert Cuykens, I would suggest to post such questions to gtk-list@gnome.org, because IIRC you are trying to code a GTK app ... Additionally I would suggest to learn C/C++ first to get a better understanding of the whole language structure. Or at least please join the c# IRC channel at irc.freenode.net to ask such questions, it's quite annoying to see them on a list which is dedicated to an UNIX OS. Scott Mitchell schrieb: > On Sun, Feb 20, 2005 at 08:41:30AM +0100, Gert Cuykens wrote: > >>So if data is declared as a gchar *data; for example, then the value >>of data is a memory adress right ? So if A=data; and B=&data; then A >>and B are exactly the same result right ? > > > No. A is a 'pointer to gchar' (or gchar*) and B is a 'pointer to pointer > to gchar' (or gchar**). The '&data' syntax means 'the address of the data > variable', ie. the address of a gchar*, whereas data itself contains the > address of a gchar. > > >>Now why would anybody want a gchar when a integer is needed ? That is >>just making it more complicated then it already is? > > > Because the code in question deals with gchars (whatever they are) not > integers? They won't necessarily be the same thing on different > architectures, or even different compilers on the same architecture. Also, > the type is called 'gchar' presumably because it logically holds some kind > of character data, whereas an integer variable holds an integer. Calling > them different things in the code helps to make it clear what the > programmer's intention is, even if the two types happen to have the same > representation on a given machine/compiler. > > In any case, this stuff really has nothing to do with FreeBSD - you should > be asking these questions in a C/C++ programming group. > > Cheers, > > Scott > -- Mit freundlichen Gruessen / With kind regards DAn.I.El S. Haischt Want a complete signature??? Type at a shell prompt: $ > finger -l haischt@daniel.stefan.haischt.name
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4218A99F.4080204>