www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/28/03:45:17

From: Magnus Ljung <d93-mlj AT nada DOT kth DOT se DOT no-spam>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: String to (char *)
Date: 28 Jul 1998 09:34:06 +0200
Lines: 18
Sender: d93-mlj AT mumrik DOT nada DOT kth DOT se
Message-ID: <ie0u342h1jl.fsf@mumrik.nada.kth.se>
References: <6pinr0$alj AT nnrp1 DOT farm DOT idt DOT net>
NNTP-Posting-Host: mumrik.nada.kth.se
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

"Chia" <chia AT top DOT net> writes:

> 
> I've been programming C++ and Allegro.  I have a String called, "TheText" in
> one of my classes which I want to print to the screen with "textout()."
> 
> However, the textout() function only does (unsigned char *)'s.
> 
> I am lost when it comes to how to convert the String to this, and without
> doing that I can't print the text.  If someone could help it'd be great.
> 
> I've tried a simple typecast:  (char *)TheText,  and that didn't compile.
Try (char *)(const char *)TheText, it works for me. This isn't exactly
an elegant solution, the best way would be if textout wanted a 
(const unsigned char *).

HTH
/Magnus

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019