Hi! I'm new to these boards, and new to programming in general. I'm working on a project, and I've been stuck on this part for hours. The basics of the project are that I have to read values from an input file that correspond to ENABLE and ON states of 5 heaters. Some of them should be DISABLED while others are ENABLE and some should be OFF while others are ON.
I can't get my output to display the ENABLE and ON values like it should. All of my values come back ENABLED and ON, when I know that some of them should be DISABLED and/or OFF. My code looks something like this:
Where am I going wrong with this? I've tried everything I can think of and I always get back ON and ENABLED values. I don't know if something major or minor is wrong, but I am at a standstill with this project until I get it figured out. Please help!Code:enum on_enable {ENABLE=0, ON=1};
main()
{
int lower_state[5][2];
int n;
char on_state_labels[2][4]={{"ON "},
{OFF"};
char enable_state_labels[2][9]={{"ENABLED "}
{"DISABLED"};
for (n=0; n<5; n++)
{
scanf("%d %d", &lower_state[n][ENABLE], &lower_state[n][ON];
printf("%s", on_state_labels[lower_state[n][ON]]);
printf("%s", enable_state_labels[lower_state[n][ENABLE]]);
}
}