From owner-freebsd-questions@FreeBSD.ORG Sun Feb 20 16:21:18 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C42316A4CE for ; Sun, 20 Feb 2005 16:21:18 +0000 (GMT) Received: from smtphost.cis.strath.ac.uk (smtphost.cis.strath.ac.uk [130.159.196.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BBFE43D49 for ; Sun, 20 Feb 2005 16:21:17 +0000 (GMT) (envelope-from chodgins@cis.strath.ac.uk) Received: from [192.168.0.4] (chrishodgins.force9.co.uk [84.92.20.141]) j1KGJoWu023336; Sun, 20 Feb 2005 16:19:50 GMT Message-ID: <4218B9D6.8060100@cis.strath.ac.uk> Date: Sun, 20 Feb 2005 16:24:54 +0000 From: Chris Hodgins User-Agent: Mozilla Thunderbird 1.0 (X11/20050204) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gert Cuykens References: <5b8472dd5925a0b0b59f15cd9f8e15f3@shire.net> <675354920.20050220001731@wanadoo.fr> <20050220124749.GA523@tuatara.fishballoon.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CIS-MailScanner-Information: Please contact support@cis.strath.ac.uk for more information X-CIS-MailScanner: Found to be clean X-CIS-MailScanner-SpamCheck: not spam, SpamAssassin (score=0, required 6) X-CIS-MailScanner-From: chodgins@cis.strath.ac.uk cc: Scott Mitchell cc: freebsd-questions@freebsd.org Subject: Re: c++ X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Feb 2005 16:21:18 -0000 Gert Cuykens wrote: > On Sun, 20 Feb 2005 12:47:50 +0000, Scott Mitchell > wrote: > >>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 >> >>-- > > > Thx i think i understand now :) > > PS Freebsd source is c++ right ? So you could also call this the free > c++ question mailing list :) No. FreeBSD is written in C. This is surely a mailing list for people who want to ask and answer questions about the FreeBSD Operating System. > > Also about all the get a c++ book comments, i tryed that once but when > i ask the book a question, it doesnt say anything back. It only makes > noises when you flaper the pages trough the wind. > > By the way if somebody passing your street asking for direction you > dont answer get a map either right ? > This is more like somebody passing your street asking for directions to a street in another country. Both comp.lang.c and comp.lang.c++ are both pretty intolerant to people asking basic questions which are heavily documented in the FAQs for the newsgroups. They generally expect you to have at least tried to understand what you are doing before asking a question. If you had tried to understand your problem and looked at the faqs you would have found an amazing amount of information on what you are after. Before you do anything else you should now go read http://www.eskimo.com/~scs/C-faq/top.html and educate yourself a bit more about C. People are not trying to be unhelpful when the tell you to RTFM or read a book. They are trying to point out areas of knowledge that you can reference to gain more insight into your problem. Noone is just going to do your homework for you. Good luck learning about C. Chris