delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/11/07:46:22

From: Neil Goldberg <ngoldber AT mitre DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: allegro textout
Date: Tue, 10 Aug 1999 09:44:42 +0100
Organization: The MITRE Corporation
Lines: 31
Message-ID: <37AFE67A.7FF6@mitre.org>
References: <7op7if$src$1 AT garnet DOT nbnet DOT nb DOT ca>
NNTP-Posting-Host: mm58842-pc.mitre.org
Mime-Version: 1.0
X-Trace: top.mitre.org 934292552 7911 128.29.96.60 (10 Aug 1999 13:42:32 GMT)
X-Complaints-To: usenet AT news DOT mitre DOT org
NNTP-Posting-Date: 10 Aug 1999 13:42:32 GMT
X-Mailer: Mozilla 3.04 (WinNT; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

guthrie wrote:
> 
> how can I , if even possible , print a string or char array out to the
> screen using the textout  or textout_centre allegro functions?
> 
> so far i have only used the functions as follows ::
> 
> textout (screen, font , " Rotate Left  " , 300 , 125, color1);
> 
> using the string  like that
> 
> but what if i want to  use a variable in place of the  " Rotate Left " part
> ?
> 
> do i have to use char[]  or string  ?.... i haven't been able to get string
> to work at all and haven't tried the char array yet.
> 
> Is this possible or do i have to make a new toextout function?
> 
use char[some_length] or char *.

Do not use any string classes.
Note that whenever you can implicitly use a string like "rotate left"
you can use a char * (char []). This is because "Rotate left" is
actually a constant pointer to the string "Rotate left" that's stuck
somewhere in your data segment. In other words, passing "Rotate left"
for a char * parameter is like passing 5  (or some constant) for an int
parameter.

Is that fairly clear?
moogla

- Raw text -


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