| www.delorie.com/archives/browse.cgi | search |
| From: | jaspeers AT aol DOT com (Jaspeers) |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Centering printf text on a 80 column screen |
| Date: | 18 Apr 1997 02:13:57 GMT |
| Organization: | AOL http://www.aol.com |
| Lines: | 10 |
| Message-ID: | <19970418021200.WAA23488@ladder01.news.aol.com> |
| References: | <334B8183 DOT 2781 AT LSTM DOT Ruhr-UNI-Bochum DOT De> |
| NNTP-Posting-Host: | ladder01.news.aol.com |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Here's a very simple way of doing it:
void center_text(int y, char *text_string)
{
gotoxy(40-strlen(text_string) / 2, y);
cprintf(text_string);
}
Visit my web page at: http://members.aol.com/jaspeers
Download source code in C and Basic!
Download ZEEK World, and Invaders from Sector X(coming soon!).
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |