Hi um I'm not really sure what this means but this is an assignment for my programming class. The professor says to create a box where Row,Col,Color are variables. How does that work can someone explain to me?
Printable View
Hi um I'm not really sure what this means but this is an assignment for my programming class. The professor says to create a box where Row,Col,Color are variables. How does that work can someone explain to me?
We can guess what is most likely. However, I would suggest that you go to them and be sure that you know what they want you to achieve.
Have a piece of paper and draw down what the output of the program should be.
The char all have values - they are variables of a constant sort in your character set. The box drawing char's are the same way.
If you don't have an ascii type table for your character set with the decimal values, you can download one from the net - ascii_table.com was one such place, iirc. Anyway, Google it, and you'll find lots of sites for it. You can also print up your char set from your computer if you want to:
The char's you need are in the extended section, above 127.Code:#include <stdio.h>
int main() {
int i;
for(i=1;i<256;i++) {
printf("%3d: %c ",i,i);
}
printf("\n");
return 0;
}
These are some that I've used:
There are char's for both single and double sided box figures. Your values may vary from these, by the way.Code:#define VRT 186 //vertical bar
#define HRZ2 205 //horizontal double bar
#define HRZ1 196 //horizontal single bar
#define TUP 202 //T with upward bar
#define TDWN 203 //T with downward bar
#define INTR 215 //intersection
#define LLCNR 200 //lower left corner
#define LUCNR 201 //left upper corner
#define RLCNR 188 //right lower corner
#define RUCNR 187 //right upper corner
#define LINTR 199 //left intersection -probably a T for the side
#define RINTR 182 //right intersection - ditto
Have fun! :cool: