From: Neil Goldberg 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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