RE: C programming question




Tue, 13 Apr 2010 17:29:51 -0500 <ron.l.johnson@xxxxxxx> wrote:

On 2010-04-13 17:16, Stephen Powell wrote:
I realize that this is not a C forum, per se, but this is a Debian-specific
C question. I am trying to add support to the parted utility for CMS-formatted
[snip]

I know how to do this in PL/I, but despite having spent the last two hours
paging through a C language reference manual, I couldn't find any examples
of overlaying two structures. I did find reference to something called
a union, but I don't have enough knowledge to know what to do. Does
anyone know how to do this?


union is exactly what you need.


Yes thats absolutely right. Remember since C is a powerful, low level, and untyped programming language untagged unions are consider unsafe.

Good luck though!

"I'm feeling lucky" sample c code union

http://www.wellho.net/resources/ex.php4?item=c209/union.c

--
Dissent is patriotic, remember?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/4BC4F05F.6060809@xxxxxxx


_________________________________________________________________
Hotmail & Messenger are available on your phone. Try now.
http://go.microsoft.com/?linkid=9724461

Relevant Pages

  • Top Facts: State Of The Union
    ... the economy has created 1.9 million private sector ... The top 1 percent of Americans own 40 percent of our country?s wealth ... China spent 9 percent of its GDP on infrastructure. ... Union membership is at a 70-year low. ...
    (rec.gambling.poker)
  • Re: Urgent News: Inaugural Accommodations still available!
    ... I was thinking about you and Marsha today while I watched CNN's new Sunday ... morning show, "State of the Union." ... They spent a lot of camera time on the ...
    (alt.support.stop-smoking)
  • Re: Should union dues back political causes?
    ... must join the union in order to have a job in her school district. ... It costs $640/hr of which one-third is spent on political causes. ... the union and have his money spent on causes with which he disagrees. ... They lie to their members. ...
    (soc.retirement)
  • [PATCH 4/7] UML - Fix load average >=1
    ... void timer_handler(int sig, union uml_pt_regs *regs) ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • [PATCH] UML - fix update_process_times call
    ... void timer_handler(int sig, union uml_pt_regs *regs) ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)