User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:preprocessor:undef

Table of Contents

#undef

Description

With the # undef a macro can be overridden.
Status “defined” or “undefined” is an important characteristic of an identifier, regardless of its actual definition.
The # ifdef and # ifndef can be used to check whether an identifier is currently defined or not.

Syntax

#undef macro_name

c undef example

  #include <stdio.h>
 
  void)
  {
    #define TESTDEFINE 1
      printf("%d\n", TESTDEFINE);
 
    #undef TESTDEFINE
 
    #define TESTDEFINE 42
      printf("%d\n", TESTDEFINE);
 
    return 0;
  }

output

   1
   42

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
c/preprocessor/undef.txt · Last modified: 2024/02/16 01:06 (external edit)

Impressum Datenschutz

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant