🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #52

type casting and const

#52
From: Tom Lanning
Date: Wed, 05 Mar 1986 00:12
10 lines
1022 bytes
	I have a class, "string", that can be converted to "char*".  I
want the converted object to be "readonly", i.e. "const".  I have been
using "operator char* ()", but would like to know if there is a way
to get "const char*".  I do not want to use intermediate types since
I want to use "string" and "const char*" together without explict type
casting.  Any help would be appreciated, thanks.
-- 

  Tom Lanning   AT&T Bell Laboratories   Columbus OH   43213     614-860-4153
Technical Details
Message-ID: <4187@cbrma.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!cbuxc!cbuxb!cbrma!trl

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 alpha 5/22/85; site cbrma.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!cbuxc!cbuxb!cbrma!trl
From: trl@cbrma.UUCP (Tom Lanning)
Newsgroups: net.lang.c++
Subject: type casting and const
Message-ID: <4187@cbrma.UUCP>
Date: Tue, 4-Mar-86 19:12:40 EST
Article-I.D.: cbrma.4187
Posted: Tue Mar  4 19:12:40 1986
Date-Received: Fri, 7-Mar-86 03:26:38 EST
Distribution: net
Organization: AT&T-BL, RMAS, Columbus
Lines: 10
Keywords: const casting