STUPID QUESTION ~!

HELLO everybody ..
i have a simple question about arrays
i want to make the default values of arrays is{'*')
i dont know how?? and when i change certain value in arrays {'*'} will changed to the new value
this m system("cls");

cout<<"\t\tA B C D"<<endl;
for (int i=0; i<10; i++)
{
cout<<"\t"<<(i+1)<<"\t";
for (int j=0; j<4; j++)
{

cout<<melaccaKL[i][j];
cout<<" ";

}
cout<<endl;

}
cout<<endl<<endl;
system("PAUSE");
system("cls");

the output for this code is like this
1
2
3
4
5
6
      A B C D
     1//---->>NO '*' I WANT THEM FILLED OF '*'
     2
     3
     4
     5        
Last edited on
closed account (zb0S216C)
Filling a char array with asterisks is a simple task:

 
char String[] = "*****"; // 6 characters in total 

Or:

1
2
3
4
5
char String[6] = {0};
unsigned short RealStringLen((sizeof(String) / sizeof(char)) - 1);

for(unsigned short Char(0U); Char < RealStringLen; ++Char)
    Char[String] = '*';


Wazzak
Last edited on
Topic archived. No new replies allowed.