I need to use printf to display a string (2D), one char at a time. This DOESN'T work: (why and what will) (NOTE: the pump is just part of the program I'm making. Ignore.)
PHP Code:
#include "stdafx.h"
#define _clrscr
#include <monkey.h>
//12x30
char stuff[7][28] = {" _________________________ ",
"| | | | |",
"| | | _____ | |",
"| | | | | | |",
"| | |_|_____| | |",
"| | | |",
"|___|___________|_________|"};
void display();
int main(int argc, char* argv[])
{
//PUMP
while(1)
{
display();
getch();
clrscr();
}
return 0;
}
void display()
{
for(int loop2 = 0; loop2 < 7; loop2++)
{
for(int loop1 = 0; loop1 < 28; loop1++)
{
char* displayer = new char [1];
displayer[0] = stuff[loop2][loop1];
printf(displayer);
if(loop1 == 27)
printf("\n");
}
}
}