From: Magnus Ljung 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: References: <6pinr0$alj AT nnrp1 DOT farm DOT idt DOT net> NNTP-Posting-Host: mumrik.nada.kth.se Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk "Chia" 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