0

Hello Guys!

Need some help.

I basically want to align my menu to center. I have tried the following:
1 . SetConsoleCursorPosition();
2. gotoxy();
....etc

But none what so ever works.....

Here is my code menu:

void printMenu()
{

	void Bottomline(char *text);
	void Headline(char *text);
	void EmptyLine();
      
     int ans;
     do
     {
		 
		  cout << "\nPlease choose from the following options:\n\n";
		  cout << "1: Search for a file\n\n";
		  cout << "2: Create a new file\n\n";
		  cout << "3: View entire catalogue\n\n";
		  cout << "4: Exit from the program\n\n";
		  cin  >> ans;
		  Bottomline("End");
          cin.ignore(80,'\n');
          options(ans);	
     }
	 while(ans!=4);
};

Thanks in Advance

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by rEhSi_123
0

Just put some spaces or tabs, that is, \t characters at the beginning of the menu lines.

Very good Sir!

Thanks alot.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.