A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

How to redefine a Macro in C?
Q:

How to redefine a Macro in C?

0

How to redefine a Macro in C?

The process to redefine a Macro is:

  1. Macro must be defined.
  2. When, you want to redefine the Macro, first of all, undefined the Macro by using #undef preprocessor directive.
  3. And, then define the Macro again by using #define preprocessor directive.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Example:

#include <stdio.h>

#define NUM 100

int main()
{
	//printing the value of NUM
	printf("NUM: %d\n", NUM);
		
	//redefining the Macor: NUM 
	#undef NUM
	#define NUM 200
	
	//printing the value of NUM 
	printf("NUM: %d\n", NUM);
	
	return 0;
}

Output

    NUM: 100
    NUM: 200

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now