UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do you override a defined macro?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Professional Tutor with 15 years of experience.

We can use the #ifdef and #undef directive to undefine a previously defined macro.
Comments

C and linux Expert

You can use the #undef preprocessor directive to undefine (override) a previously defined macro. Many programmers like to ensure that their applications are using their own terms when defining symbols such as TRUE and FALSE.
Comments

Computer & Maths Professor

You can use the #undef preprocessor directive to undefine (override) a previously defined macro.
Comments

You can't. The command line is handled before any source and header files. If a source file defines a macro, then it must not be defined before, and will get the new value from now on. The only way to change it, is to #undef and #define it again, at a later point. If you have access to a header...
read more
You can't. The command line is handled before any source and header files. If a source file defines a macro, then it must not be defined before, and will get the new value from now on. The only way to change it, is to #undef and #define it again, at a later point. If you have access to a header that is included after the definition, then you have a chance. read less
Comments

website and mobile application development training, digital marketing training

Yes, You can use the #undef preprocessor directive to undefine (override) a previously defined macro
Comments

Tutor

You can use the #undef preprocessor directive to undefine (override) a previously defined macro.
Comments

Thanks for your question Sharmistha.... By using #undef pre-processor directive we can override a defined macro. Thanks, Team DishaaPro, www.dishaapro.com
Comments

#define MYMACRO(x) x*x //previously defined macro ... #ifdef MYMACRO #undef MYMACRO #define MYMACRO(x) x*x*x //new definition #endif int main() { printf("%d\n", MYMACRO(2)); return 0; }
Comments

Science Expert, C & C++ Strong

You can use the #undef preprocessor directive to undefine (override) a previously defined macro. Many programmers like to ensure that their applications are using their own terms when defining symbols such as TRUE and FALSE. Your program can check to see whether these symbols have been defined already,...
read more
You can use the #undef preprocessor directive to undefine (override) a previously defined macro. Many programmers like to ensure that their applications are using their own terms when defining symbols such as TRUE and FALSE. Your program can check to see whether these symbols have been defined already, and if they have, you can override them with your own definitions of TRUE and FALSE. read less
Comments

LearnHowToLearn, Expert In Programming Languages

Just redefine it.
Comments

View 10 more Answers

Related Questions

What will the pre-processor do for a program?
The pre processor takes a look at your source code just before it goes off to the compiler, does a little formatting, and carries out any instructions you have given it. Each # command that the preprocessor...
Neel
0 0
6
In how many days can we learn the C language?
Around one month and depends upon you how much time you give.
Ravi Shankar
0 0
9
The object file is in binary code, and the machine understands the binary language. So why object files are not executed?
Object files are sources compiled into binary machine language, but they do not have library files, so they are not executed.
Dhruvil
0 0
9
How can you avoid including a header more than once?
Use following in your header file. #ifndef "header_name" #define "header_name" /*header definition starts here*/ #endif /* header file ends here*/ Whenever you will include the same header file,...
Deepak
0 0
7
hi guyz! i am dng my 2nd yr in engg n i wanna strengthen my C n C++ prgmmng skills........which s d best way for it?? can u suggest me sum gud books to refer??
you can study the online websites and also solve the output,error oriented program in LET US C book by yaswant
Logeshwari

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Efficient Learning Strategies
Type your notes after class Write your notes onto flashcards - Scrabble -Make posters Review flashcards while walking, at gym, etc. Dog-ear pages in the reading where you can find...

Why Indexing Should Start From Zero In Array ?
Why numbering should start at zero? To denote the subsequence of natural numbers 2, 3, ..., 12 without the pernicious three dots, fourconventions are open to usa) 2 ≤ i < 13b) 1 < i ≤ 12c)...

Some Tricky Questions in C
Can you write two functions in which one executes before main function and other executes after the main function? #pragma startup #pragma exit Where, priority is optional integer value.For user priority...

Pointers and References
Are reference and pointers same? No. I have seen this confusion crumbling up among the student from the first day. So better clear out this confusion at thevery beginning. Pointers and reference...

Array vs Linked List
Array Linked List Accessing element is easy. Accessing element is difficult compare to Array. Easy to use. Difficult to use. Memory is Fixed size. Memory is variable size. If...

Recommended Articles

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more