Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting Console to Maximized in Dev C++
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/190543/changing-the-width-of-a-windows-console-window">Changing the width of a Windows console window?</a> </p> </blockquote> <p>Im writing a simple brick breaker program. How do I maximize the console window, when the program starts.</p> <pre><code>#include &lt;iostream&gt; #include &lt;windows.h&gt; #include &lt;algorithm&gt; #include &lt;conio.h&gt; #define _WIN32_WINNT 0x500 using namespace std; int lives = 2; void gotoxy(int x , int y); void hideCursor(); class Grid { public: char grid[20][79]; void fill() { for(int i = 0; i &lt; 20; i++) { for(int j = 0; j &lt; 79; j++) { grid [i][j] = (char)176; } } } void print() { gotoxy(0,0); for(int i = 0; i &lt; 20; i++) { for(int j = 0; j &lt; 79; j++) { cout &lt;&lt; grid [i][j]; } cout &lt;&lt; endl; } } }; class Paddle { public: int x_pos; char paddle[7]; void fill() { x_pos = 35; for (int i = 0; i &lt; 7; i++) paddle [i] = (char)219; } void print() { gotoxy (x_pos,23); for (int j = 0; j &lt; 7; j++) cout &lt;&lt; paddle [j]; } void redraw() { for(int i = 0; i &lt; 80; i++) { gotoxy (0+i,23); cout &lt;&lt; " "; } print(); } }; class Ball { public: int x_pos, y_pos; bool crashed; char ball; void create() { ball = 'O'; crashed = false; x_pos = 38; y_pos = 22; } void show() { gotoxy (x_pos,y_pos); cout &lt;&lt; ball; } }; int main() { char move; Grid grid; Paddle paddle; Ball ball; grid.fill(); paddle.fill(); grid.print(); paddle.print(); ball.create(); ball.show(); hideCursor(); while(!ball.crashed) { move = getch(); move = getch(); if(move == 75) paddle.x_pos--; else if(move == 77) paddle.x_pos++; paddle.redraw(); } cin.get(); return 0; } void hideCursor() { HANDLE cmd; CONSOLE_CURSOR_INFO cur; char *str = (char*)malloc(32); cur.dwSize = 1; cur.bVisible = FALSE; cmd = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorInfo(cmd, &amp;cur); } void gotoxy(int x , int y) { COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload