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 18:33:46 -0800 (PST) Organization: http://groups.google.com Message-ID: <6cf0950a-d2a3-4df4-9f19-23474d568c28@q40g2000prh.googlegroups.com> References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <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> <0c9a8fbb-465e-4a9b-a9e6-dba67b648283@t19g2000prd.googlegroups.com> 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 1297218827 6970 127.0.0.1 (9 Feb 2011 02:33:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 9 Feb 2011 02:33:47 +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:17073 Date: 2011-02-08T18:33:46-08:00 List-Id: On Feb 8, 5:56=A0pm, Shark8 wrote: > > That is a far more elegant & practical solution, IMO. > > The problem really comes into play with the question > "How do you set the third bit?" because there is no > such context (a device in your example) with which > to base your answer, and so you must give an > answer somewhat tangential to what the actual > practical problem may be. Since this is an interview and not the final exam of a college class, I don't see a problem with giving an answer that reflects how you'd actually approach the problem. Dmitry asks, "How do you set the third bit?", and you say, "Well, if the third bit is a Ready bit in a hardware I/O register, I'd define a struct with bit components [yes, I think C has those] and just assign 1 to the component, which would be more readable than using a mask." If the interviewer were Dmitry, I think he'd be impressed. If the interviewer were one of the programmers Dmitry was complaining about, they may not have a clue what you're talking about. So you have to judge. But a good, experienced programmer knows that sometimes the thing that someone's asking you for isn't always what they really want, and sometimes you have to dig a bit deeper to find out whether it really is what they need, or whether they've just assumed a solution to some deeper problem and maybe you have a better solution. Answering in this way tells the interviewer that you have the ability to do this kind of probing when it's necessary, assuming the interviewer isn't an idiot. -- Adam