Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Practical Use Cases | Conditional compilation
C Preprocessing

Pyyhkäise näyttääksesi valikon

book
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

Tehtävä

Swipe to start coding

  1. Use the necessary macro to check the existence of PROTOCOL_TCP and PROTOCOL_UDP, and don't forget to properly close the necessary macro.
  2. Use a macro to check the values of the PROTOCOL_TCP and PROTOCOL_UDP macros, and correctly close it.
  3. Use a macro to check an additional condition.
  4. Use a macro to create an error message in case of an error.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 3
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

Awesome!

Completion rate improved to 5.56

book
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

Tehtävä

Swipe to start coding

  1. Use the necessary macro to check the existence of PROTOCOL_TCP and PROTOCOL_UDP, and don't forget to properly close the necessary macro.
  2. Use a macro to check the values of the PROTOCOL_TCP and PROTOCOL_UDP macros, and correctly close it.
  3. Use a macro to check an additional condition.
  4. Use a macro to create an error message in case of an error.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

close

Awesome!

Completion rate improved to 5.56

Pyyhkäise näyttääksesi valikon

some-alt