The Problem: You're writing a program for multiple platforms. As a result you have a lot of #ifdef statements sprinkled through out the code. So many in fact that they are make things look ugly and the code is hard to read. For example: void send_cmd(void) {  send_cmd_start(); #ifdef FE_TEXTURE  send_texture(); #endif /* FE_TEXTURE */ #ifdef FE_COLOR  send_background();  if (foreground != TRANSPARENT)  send_foreground(); #endif /* FE_COLOR */ #ifdef FE_SIZE  if (size != 0)  send_size(); #endif /* FE_SIZE */ #ifdef FE_REPLAY  if (prev_cmd == '\0') {  prev_cmd = cur_cmd;  prev_param = cur_param;  } #endif /* FE_REPLAY */  send_cmd_end(); }

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 12E
icon
Related questions
Question

The Problem: You're writing a program for multiple platforms. As a result
you have a lot of #ifdef statements sprinkled through out the code. So many in
fact that they are make things look ugly and the code is hard to read.
For example:
void send_cmd(void)
{
 send_cmd_start();
#ifdef FE_TEXTURE
 send_texture();
#endif /* FE_TEXTURE */
#ifdef FE_COLOR
 send_background();
 if (foreground != TRANSPARENT)
 send_foreground();
#endif /* FE_COLOR */
#ifdef FE_SIZE
 if (size != 0)
 send_size();
#endif /* FE_SIZE */
#ifdef FE_REPLAY
 if (prev_cmd == '\0') {
 prev_cmd = cur_cmd;
 prev_param = cur_param;
 }
#endif /* FE_REPLAY */
 send_cmd_end();
}

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Concept of Threads
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT