Article View: comp.lang.c++.moderated
Article #30Re: Meaning of the specifier volatile?
From: Dominique Bernardi
Date: Thu, 04 Jan 1996 19:08
Date: Thu, 04 Jan 1996 19:08
32 lines
1533 bytes
1533 bytes
X-Original-Date: Thu, 04 Jan 1996 16:09:37 +0100
In article (Dans l'article) <4cff74$gfj@netlab.cs.rpi.edu>,
rmartin@oma.com (Robert C. Martin) wrote (=E9crivait)=A0:
<Snip>
>int * volatile tty =3D 0x100; // 0x100 is the addr of the tty device.
>
>*tty =3D 'h'; // prints a 'c' on the tty;
>
>void PrintMessage(char *s)
>{
> for(; *s; s++) *tty =3D *s; // prints the string on the tty.
>}
>
I would have written
volatile int * tty =3D 0x100; // 0x100 is the addr of the tty device.
instead. The meaning is *not* the same.
--=20
Dominique Bernardi, Theorie des Nombres
Universite Pierre et Marie Curie
4 place Jussieu - F75005 Paris Tel (33-1) 44275441
bernardi@mathp6.jussieu.fr
[ comp.lang.c++.moderated is a moderated newsgroup. Submit articles ]
[ to <c++-submit@netlab.cs.rpi.edu>. The moderation policy can be ]
[ retrieved from <http://netlab.cs.rpi.edu/~cppmods/guide.html>. ]
[ Moderators can be reached at: c++-request@netlab.cs.rpi.edu. ]
Technical Details
Message-ID:
<4ch8ja$lj7@netlab.cs.rpi.edu>Path:
arc1-ca.pugleaf.net!kbad.eglin.af.mil!rpi!not-for-mailReferences:
<4c9740$27n@netlab.cs.rpi.edu> <4cff74$gfj@netlab.cs.rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!kbad.eglin.af.mil!rpi!not-for-mail From: bernardi@mathp6.jussieu.fr (Dominique Bernardi) Newsgroups: comp.lang.c++.moderated,comp.lang.c++ Subject: Re: Meaning of the specifier volatile? Date: 4 Jan 1996 19:08:26 -0000 Organization: Universiti Pierre & Marie Curie Sender: cppmods@netlab.cs.rpi.edu Approved: Dietmar.Kuehl@uni-konstanz.de Message-ID: <4ch8ja$lj7@netlab.cs.rpi.edu> References: <4c9740$27n@netlab.cs.rpi.edu> <4cff74$gfj@netlab.cs.rpi.edu> NNTP-Posting-Host: netlab.cs.rpi.edu