home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
turbo_c
/
tc130.arc
/
CENTER.DOC
< prev
next >
Wrap
Text File
|
1987-08-20
|
1KB
|
41 lines
NAME
center -- center a string
SYNOPSIS
r = center(string, size);
int r; starting column for centering
char *string; string to center
int size; width of field for centering
DESCRIPTION
This function returns the starting column to print a
string for the string to be centered in a field of
"size" characters. For the screen, the width would
usually be 80, and for printers, either 80 or 132.
The string MUST NOT BE longer than the size specified,
since there is no error cheking for this condition and
an unusable result will be returned.
EXAMPLE
char title[] = "Title of Program";
main() {
int i;
i = center(title, 80);
d_say(2, i, title); /* display title centered in row 2 */
}
This function is found in SMTCx.LIB for the Turbo-C Compiler