Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Cancel Macro | Macros
C Preprocessing
course content

Kursinhalt

C Preprocessing

C Preprocessing

1. Introduction to Preprocessing
2. Macros
3. Conditional compilation

book
Cancel Macro

The #undef directive in the C programming language is used to undefine a previously declared macro created using the #define directive.

python

This allows you to remove a macro from the current scope so that its name can be redefined or no longer used in your program.

Macros are global: Macros operate at the preprocessor level, and their scope extends to the entire file where they are defined. Once redefined, the new value will be used wherever that macro appears later in the code.

c

main

copy
1234567891011
#include <stdio.h> #define MAX 100 int main() { printf("MAX = %d\n", MAX); // MAX = 100 #undef MAX // remove macros MAX #define MAX 200 // define new macros MAX printf("MAX = %d\n", MAX); // MAX = 200 return 0; }
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 4
toggle bottom row

book
Cancel Macro

The #undef directive in the C programming language is used to undefine a previously declared macro created using the #define directive.

python

This allows you to remove a macro from the current scope so that its name can be redefined or no longer used in your program.

Macros are global: Macros operate at the preprocessor level, and their scope extends to the entire file where they are defined. Once redefined, the new value will be used wherever that macro appears later in the code.

c

main

copy
1234567891011
#include <stdio.h> #define MAX 100 int main() { printf("MAX = %d\n", MAX); // MAX = 100 #undef MAX // remove macros MAX #define MAX 200 // define new macros MAX printf("MAX = %d\n", MAX); // MAX = 200 return 0; }
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 4
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
Wir sind enttäuscht, dass etwas schief gelaufen ist. Was ist passiert?
some-alt