From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!q40g2000prh.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? Date: Tue, 8 Feb 2011 13:06:03 -0800 (PST) Organization: http://groups.google.com Message-ID: <87411ec5-c197-4143-8ef1-ab9ddb20bcc6@q40g2000prh.googlegroups.com> References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <19fh1chm74f9.11cws0j5bckze.dlg@40tude.net> <4d4ff70e$0$6886$9b4e6d93@newsspool2.arcor-online.net> <737a6396-72bd-4a1e-8895-7d50f287960e@d28g2000yqc.googlegroups.com> <4d5008a5$0$6879$9b4e6d93@newsspool2.arcor-online.net> <4d5031fe$0$6765$9b4e6d93@newsspool3.arcor-online.net> <1f229967-d3cf-42b6-8087-c97ee08652f3@i40g2000yqh.googlegroups.com> <4d51169e$0$7657$9b4e6d93@newsspool1.arcor-online.net> <1bnp0pw1c8r5b$.guxc48qweiwe.dlg@40tude.net> <4d51a1c0$0$19486$882e7ee2@usenet-news.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1297199163 5785 127.0.0.1 (8 Feb 2011 21:06:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 8 Feb 2011 21:06:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q40g2000prh.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17036 Date: 2011-02-08T13:06:03-08:00 List-Id: On Feb 8, 12:01=A0pm, Hyman Rosen wrote: > On 2/8/2011 2:43 PM, Dmitry A. Kazakov wrote: > > > Three candidates in a row I have interviewed for a C/C++/C# position co= uld > > not answer the question how to test the 3rd bit of a byte in C. All thr= ee > > had 3+ years of programming "experience." > > =A0 =A0 =A0(byte & (1 << (3 - 1))) That's not the correct answer. The correct answer is to ask, "Third bit from which end?" If you just assume one or the other (byte & 0x04, or byte & 0x20) and write code without asking for the specs to be clarified, you'd fail if I were the interviewer. Just saying. -- Adam