Smithy006
May 18th, 2001, 12:13 AM
Hi All,
Just a quick question with hopefully, a quikc and easy answer.
I want to assign a few arrays to a char at runtime after the 2d arrary has been declared...
So basically I want to do this......
char mychar [10] [10] ={ {'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , 'W' , '~' , '~'},
{'~' , 'T' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , 'Y' , '~' , '~' , '~'},
{'~' , 'B' , '~' , 'B' , '~' , 'G' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'} };
but instead of assigning it at the start I want to assign it at runtime.
i have tried doing something like this....
mychar [10] [10] ={ {'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , 'W' , '~' , '~'},
{'~' , 'T' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , 'Y' , '~' , '~' , '~'},
{'~' , 'B' , '~' , 'B' , '~' , 'G' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'} };
but the compiler is giving me errors.
Any Help would be greatly appreciated.
Thanks!
Best Regards,
Smithy.
Just a quick question with hopefully, a quikc and easy answer.
I want to assign a few arrays to a char at runtime after the 2d arrary has been declared...
So basically I want to do this......
char mychar [10] [10] ={ {'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , 'W' , '~' , '~'},
{'~' , 'T' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , 'Y' , '~' , '~' , '~'},
{'~' , 'B' , '~' , 'B' , '~' , 'G' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'} };
but instead of assigning it at the start I want to assign it at runtime.
i have tried doing something like this....
mychar [10] [10] ={ {'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , 'W' , '~' , '~'},
{'~' , 'T' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , 'Y' , '~' , '~' , '~'},
{'~' , 'B' , '~' , 'B' , '~' , 'G' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'},
{'~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~' , '~'} };
but the compiler is giving me errors.
Any Help would be greatly appreciated.
Thanks!
Best Regards,
Smithy.