Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

Kindly assist me with making a single loop out of these four 'if' statement blocks. They're in the 'void room(room *room)' function. Here's the link to the code: http://txt.do/dbyw Thank you!

OpenStudy (rsmith6559):

A simple change would be to go to if/ else if / else statement, but the switch statement is used for n-way branches.

OpenStudy (anonymous):

I'm sorry, I don't understand. How does the if/else help with making it a single loop? Why did you mention the switch statement concept? n-way branching: number of switch statements involve? Do you have anything in particular I could read? Thanks.

OpenStudy (anonymous):

My C is super rusty, but I think something like this should work: char *directions[4] = ["North \t", "South \t", "West \t", "East \t"]; for (i = 0; i < 4; i++) { if(room->neighbors[i] != NULL) { cout << directions[i]; } } or something to that extent...

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!