| title |
pop_macro | Microsoft Docs |
| ms.custom |
|
| ms.date |
11/04/2016 |
| ms.reviewer |
|
| ms.suite |
|
| ms.technology |
|
| ms.tgt_pltfrm |
|
| ms.topic |
article |
| f1_keywords |
vc-pragma.pop_macro |
pop_macro_CPP |
|
| dev_langs |
|
| helpviewer_keywords |
pop_macro pragma |
pragmas, pop_macro |
|
| ms.assetid |
3b5489d0-69ba-4c66-b572-2748af0f12bb |
| caps.latest.revision |
11 |
| author |
corob-msft |
| ms.author |
corob |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
Sets the value of the macro_name macro to the value on the top of the stack for this macro.
#pragma pop_macro("
macro_name
")
Remarks
You must first issue a push_macro for macro_name before you can do a pop_macro.
// pragma_directives_pop_macro.cpp
// compile with: /W1
#include <stdio.h>
#define X 1
#define Y 2
int main() {
printf("%d",X);
printf("\n%d",Y);
#define Y 3 // C4005
#pragma push_macro("Y")
#pragma push_macro("X")
printf("\n%d",X);
#define X 2 // C4005
printf("\n%d",X);
#pragma pop_macro("X")
printf("\n%d",X);
#pragma pop_macro("Y")
printf("\n%d",Y);
}
Pragma Directives and the __Pragma Keyword