From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28958 invoked by alias); 7 Jun 2012 11:06:34 -0000 Received: (qmail 28937 invoked by uid 22791); 7 Jun 2012 11:06:33 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jun 2012 11:06:18 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q57B6H5B025076 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Jun 2012 07:06:17 -0400 Received: from zebedee.pink (ovpn-113-24.phx2.redhat.com [10.3.113.24]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q57B6GxM018562; Thu, 7 Jun 2012 07:06:17 -0400 Message-ID: <4FD08B28.7000802@redhat.com> Date: Thu, 07 Jun 2012 11:06:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: using hex in gcc References: <33971305.post@talk.nabble.com> <4FCFBE5C.6060404@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg00068.txt.bz2 On 06/07/2012 07:33 AM, dhruv pant wrote: > thanks got it...i was actually thinking in some other way.... > so basically everything is actually stored in binary form.it's for our > convenience and readability that we are converting them to hex or > decimal..... > so suppose... > unsigned int i=10 > printf("%x",i) //this will print the hex equivalent of 10? Exactly. Pocket calculators usually store numbers in decimal, because for them most of the work is in the I/O. Computers usually store numbers in binary: how you print it is up to you. Andrew.