chars and couts, easy kinda question.
Hi all,
I was wondering if anybody has any idea why my simple 'V' Graphic drawing program isn't work, it appears to be working but isn't diaplaying the v sybol on the screen. The way it works is you type in a smybol and it makes a v using that symbol/char. Quite simple but i can't get it to display properly, below is the code i made in vis c++...
#include <iostream.h>
//declare variables
char sim;
char vee [10] [20] = { {sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ', sim , ' '},
{' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim, ' ' , ' '},
{' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ', ' ' , 'V'},
{'V' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ', ' ' , 'V'},
{'V' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ', ' ' , 'V'},
{'V' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ', ' ' , 'V'},
{'V' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ', ' ' , 'V'},
{'V' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ', ' ' , 'V'},
{'V' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ', ' ' , 'V'},
{'V' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ', ' ' , 'V'}};
int col;
int row;
int main()
{
cout << "****** Welcome to the V Drawing Program!! ********\n" << endl;
cout << " Program By Ben Smith\n" << endl;
cout << "Please enter any symbol to create the graphic V: ";
cin >> sim;
for( row = 0; row = 10; row++)
{
for( col = 0; col = 20; col++)
{
cout << vee [row] [col];
}
}
return 0;
}
Any response will be greatly appreciated!!
Thanks:)
Regards,
Smithy.
Updated version of my code
I've been working on it for the past 30 mins, here's an updated version of my code...
#include <iostream.h>
//declare variables
char sim;
char vee [10] [20] = { {sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ', sim , ' '},
{' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim, ' ' , ' '},
{' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ', ' ' , ' '},
{' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ', ' ' , ' '},
{' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ', ' ' , ' '},
{' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ', ' ' , ' '},
{' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ', ' ' , ' '},
{' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ', ' ' , ' '},
{' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ', ' ' , ' '},
{' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , sim , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ', ' ' , ' '}};
int col;
int row;
int main()
{
cout << "****** Welcome to the V Drawing Program!! ********\n" << endl;
cout << " Program By Ben Smith\n" << endl;
cout << "Please enter any symbol to create the graphic V: ";
cin >> sim;
for( int row = 0; row == 10; row++)
{
for( int col = 0; col == 20; col++)
{
cout << vee [row] [col];
}
cout << endl;
}
cin >> sim;
return 0;
}
ok, i think that will do the trick
What can i say i'm too used to programming in vb :)
hehehehe
I'll try inputing the sim in after it has been cined and it should be right. I've got the row thing sorted out now, so i'm guessing i just have to create a for statement like yours to add sim to my v graphic?