I was hoping someone could explain the purpose of #undef in the mispelling problem set? I read an explanation, i just wanted to know now if the #undef effects the definitions defined in sys/resource.h or sys/time.h?


#include <ctype.h>

#include <'stdio.h>

#include <sys/resource.h>

#include <sys/time.h>

#include "dictionary.h"

#undef calculate

#undef getrusage

  • 1
    Title changed, the question isn't answered by your reference. Jul 27, 2015 at 16:58
  • 1
    question reopened!
    – kzidane
    Jul 30, 2015 at 3:43
  • #undef doesn't deal with "variables". it deals with "definitions". it's not quite clear what you want to show by your example. please add more details!
    – kzidane
    Jul 30, 2015 at 3:46

1 Answer 1


The #undef undefines a constant or macro from the pre-processor. It is usually used to specify a constant for the preprocessor in a very specific range of the code.

You can check the documentation for the #undef that is located on the Replace section of the reference here.

Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .