How to center a one line message in a C++ program

This article is part of a series of my articles containing snippets of C++ code that will perform various functions.Feel free to use them or modify them as needed, AS LONG AS YOU DO NOT RE-PUBLISH THEM.  Wheter you need an inspiration for a project, a way around a coding problem, or you are just curious feel free to check out the table of contents to my series right here.

/* Nesecary includes:

My spacer function

</p>

</p>

Code:    */
</p>

void centermessage (int cols, char message[])  //centers message
</p>

{
</p>

int mlength=strlen(message);
</p>

mlength=(mlength+1)/2;
</p>

mlength=(cols/2)-mlength;
</p>

spacer (mlength);
</p>

cout<
</p>

}
</p>

//End of Code
</p>

z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z
z z z z z z z z z z z z z z z z z z Liked What You Saw? z z z z z z z z z z z z z z z z z z z z
z z z z z z z z z z z z z z z z z z z Theres More Where z z z z z z z z z z z z z z z z z z z z
z z z z z z z z z z z z z z z z z z That Came From Here  z z z z z z z z z z z z z z z z z z z
z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z z

</p>

</p>

About Author

Leave A Reply