I'm trying to write a simple console game.
I want to refresh console 30 times per second. Usually this is not a problem, but this time I'm working with an array of size 30x30, and printing it using two loops is simply not fast enough.
I noticed that
<code>printf( "%s\n", myarray );</code>
is quick enough, but it doesn't work properly with 2d arrays.
Is there a function that will make my array appear "instantly" on screen?
I'm using this function to print my array:
void draw(char screen[32][31]){
for (int x=0;x<32;x++){
for (int y=0;y<31;y++){
cout<<screen[x][y];
}
cout<<endl;
}
}