Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'compiler': 0.07; 'received:internal': 0.09; 'subject:into': 0.09; '24,': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'subject:variable': 0.16; 'typedef': 0.16; 'value;': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'mon,': 0.24; 'header:In-Reply-To:1': 0.27; 'struct': 0.31; 'received:66': 0.35; 'subject:?': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'subject:Can': 0.60; 'from:no real name:2**0': 0.61; 'header:Message-Id:1': 0.63; 'email addr:gmail.com': 0.63; '2014,': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= message-id:from:to:mime-version:content-transfer-encoding :content-type:subject:date:in-reply-to:references; s=mesmtp; bh= wShUL02ZaxeeahNAwbgkqZTILgk=; b=H7KZ31nBUJ5y13y/Uen2zA4N/LQfxyFc 8QpY7D0fTj7YYEpngofwWJKJtPNZStF38BTbMhHlgdaqXTpQkR4nu3U18MahLOzf CRSLXRaXaM0STswa4+0MnafqPhWzYf6oMvbruCcLs/9mqywdZBbZ9dg3GW4RXEeu 4AvXOriO0fs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:subject:date:in-reply-to :references; s=smtpout; bh=wShUL02ZaxeeahNAwbgkqZTILgk=; b=YB4Xq jn+vOHmbOcwnqqG1JzZBInw3rHMWLIOkGDSQFRXDPk+yA3g1H3FM49/gS4OV2c8O h36kNNTJ7ZTprGDs9p6ZarcCoyn+ZEHpSQKkaq6fE6ILzoy8hkI5ahm/wUktluV7 fXlIYrrUYHeaXNsMzUQPsTfPLlfGop4RnHj8cg= X-Sasl-Enc: SXV+JlfGqYUnH7TETZsQzwqd3RkGyphyId67a4wYtCbC 1393266014 From: random832@fastmail.us To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-4527a23f Subject: Re: Can global variable be passed into Python function? Date: Mon, 24 Feb 2014 13:20:14 -0500 In-Reply-To: <08aa32de-cd51-4888-bd60-2c2b53d86ecc@googlegroups.com> References: <27ac2248-0ca3-4ba6-9d25-eaad324bc5e9@googlegroups.com> <87sird7wuw.fsf@handshake.de> <8454E8CB-E6E3-452F-8E54-9A77BFF34EC2@gmail.com> <1m3gg9lbf2ln5m2kbki954t17mqni3b20k@4ax.com> <53095145$0$29985$c3e8da3$5496439d@news.astraweb.com> <877g8mcg1m.fsf@elektro.pacujo.net> <87ob1yay9m.fsf@elektro.pacujo.net> <08aa32de-cd51-4888-bd60-2c2b53d86ecc@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393266022 news.xs4all.nl 2905 [2001:888:2000:d::a6]:37693 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66989 On Mon, Feb 24, 2014, at 13:05, j.e.haque@gmail.com wrote: > typedef struct { > int value; > } Number; > > Number *o; > o = malloc(sizeof(*o)); > o->value=3; > printf("o<%p>, o->value<%p>\n", o, &o->value); > > o<0x9fe5008>, o->value<0x9fe5008> > > Is the compiler borked? That's cheating. Try printf("o<%p>", &o);