Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!ucbvax!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Volatile global variable Message-ID: <11288@dog.ee.lbl.gov> Date: 22 Mar 91 00:00:37 GMT References: <1991Mar21.160849.1520@b8.ingr.com> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 24 X-Local-Date: Thu, 21 Mar 91 16:00:37 PST In article <1991Mar21.160849.1520@b8.ingr.com> harbis@b8.ingr.com (Randy Harbison) writes: > Example: A pointer which is pointing to the address of the > system clock. This variable would change in relation to > the clock in runtime. (I am specifically interested > in the variable incrementing as the seconds increase). > 1. What TYPE would the variable be? > 2. How would I find the address of the clock (seconds)? > 3. How would I assign the variable to the clock's address? > 4. If I'm way out in left field, what would be the reasonable options? Well, you are definitely way out in machine-dependent territory (though us southpaws think `left field' is normal :-) ). Questions 1 through 3 *require* machine details in order to be answered. You have given none, and comp.lang.c is not the proper newsgroup for them anyway, so what you need to do is decide which machine(s) you need answers for and find appropriate machine-specific newsgroups. ANSI C provides the `volatile' qualifier specifically as an escape hatch to do this sort of thing, but (of necessity) does not pin down exactly what `volatile' does. -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov