home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!stanford.edu!agate!tfs.com!tfs.com!eric
- From: eric@tfs.com (Eric Smith)
- Subject: Re: pointer to constant object violation
- Message-ID: <1992Aug15.160838.28760@tfs.com>
- Organization: TFS
- References: <1992Aug15.133926@iti.gov.sg>
- Date: Sat, 15 Aug 1992 16:08:38 GMT
- Lines: 18
-
- In article <1992Aug15.133926@iti.gov.sg> nicholas@iti.gov.sg (Nicholas Tan) writes:
- >typedef char* STR;
- >//#define STR char*
- >
- >
- >class String
- >{
- > private:
- > STR str;
- >
- > public:
- > String(STR = "");
- > const STR value() const;
- ^^^^^^^^^
- That is equivalent to char * const, not const char *
-
- i.e., it's parsed as (const (char *)) for the typedef, vs ((const char) *)
- for the #define.
-