Practical Use Cases
What are #ifdef and #ifndef
#define DEBUG_MODE
#ifdef DEBUG_MODE
printf("Debugging is enabled!\n");
#endif
#ifndef RELEASE_MODE
printf("Running in development mode.\n");
#endif
Error macro
Opgave
Swipe to start coding
- Use the necessary macro to check the existence of
PROTOCOL_TCP
andPROTOCOL_UDP
, and don't forget to properly close the necessary macro. - Use a macro to check the values of the
PROTOCOL_TCP
andPROTOCOL_UDP
macros, and correctly close it. - Use a macro to check an additional condition.
- Use a macro to create an error message in case of an error.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 3. Kapitel 3
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Opsummér dette kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 5.56
Practical Use Cases
Stryg for at vise menuen
What are #ifdef and #ifndef
#define DEBUG_MODE
#ifdef DEBUG_MODE
printf("Debugging is enabled!\n");
#endif
#ifndef RELEASE_MODE
printf("Running in development mode.\n");
#endif
Error macro
Opgave
Swipe to start coding
- Use the necessary macro to check the existence of
PROTOCOL_TCP
andPROTOCOL_UDP
, and don't forget to properly close the necessary macro. - Use a macro to check the values of the
PROTOCOL_TCP
andPROTOCOL_UDP
macros, and correctly close it. - Use a macro to check an additional condition.
- Use a macro to create an error message in case of an error.
Løsning
Var alt klart?
Tak for dine kommentarer!
Awesome!
Completion rate improved to 5.56Sektion 3. Kapitel 3
single