UrbanPro

Learn C Language from the Best Tutors

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

Search in

What is a macro, and how do you use it?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

Tutor of C, Core Java, having 5 years of development experience in DRDO, Bangalore and Honeywell

Macro is used where we want to use a value many times in a code. Also there is a possibility that the in future, the value would change. Then changing the value all over the code does not make any sense. There has to be a way out through which one can make the change at one place and it would get reflected...
read more
Macro is used where we want to use a value many times in a code. Also there is a possibility that the in future, the value would change. Then changing the value all over the code does not make any sense. There has to be a way out through which one can make the change at one place and it would get reflected at all the places read less
Comments

Programming Language Tutor

Macro refers to a #define definition that is used to define words to enhance readability and understandability of the program.It defines an identifier and string or constant that is substituted for the identifier each time it is encountered in the program.This identifier is called a macro and the replacement...
read more
Macro refers to a #define definition that is used to define words to enhance readability and understandability of the program.It defines an identifier and string or constant that is substituted for the identifier each time it is encountered in the program.This identifier is called a macro and the replacement procedure is termed macros substitution. example :- #define m 10 void main(){ int b,c; b=m+1; c=b*m; printf("%d\t%d",b,c); } In the above program, we consider two statement 1. b=m+1 in this the value of m is substituted to 2 and then add 1 so result is 3 which is assigned to b, 2. c=b*m we have obtained the value of b is 3 and the value of variable m is substitute to 2, hence result is 6, assigned to c. read less
Comments

Engineer by profression, Tutor by passion

A macro is a name given to a "block of the code" which can be substituted where the code snippet is to be used for more than once. Different ways of using macros are as follows: 1) Defining Macros without values eg- #define MACRO1. In this case we use them as testing conditions along with ifdef statements. 2)...
read more
A macro is a name given to a "block of the code" which can be substituted where the code snippet is to be used for more than once. Different ways of using macros are as follows: 1) Defining Macros without values eg- #define MACRO1. In this case we use them as testing conditions along with ifdef statements. 2) Macros with values,eg - #define MACRO1 25. In the preprocessing stage of the compilation process, the name of this macro is replaced with macros value all over the code. 3) Macros with piece of code as their values, eg - #define MACRO(i) (i*78) * (45+x) read less
Comments

View 1 more Answers

Related Questions

How do I get 6 power 13 in c language?
By using pow() function #include <math.h>#include <stdio.h>int main() { double base = 6.0; double exp = 13.0; double result = pow(base, exp); printf("%.1lf^%.1lf = %.2lf", base, exp, result); return 0;}
Tanush
0 0
5
Can we pass arguments in the main function in C language?
Yes. it is possible to pass arguments into the main function.
Mukesh
0 0
7
Is it possible to write big safe programs in C++?
yes. C++ is generally used to write system software. For example windows operating system are writeen in C++. Most of the operating system, device driver and antivirus programs are written by using C++.
Sapna
0 0
6
How is this site helpful for me? I am looking for a job in the field of Programming in C.
C programming is used mostly for developing drivers, embedded softwares, compilers and more importantly the operating systems themselves for example UNIX OS which is completely written in C language. So...
Umang
Is C programming and embedded C the one and the same?
in c language only u can learn c language concepts but in embeded c u can learn the in depth knowlege on c and embeded for machinelearning purpose i prefered to learn embeded c
Yogesh
0 0
5

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

Ask a Question

Related Lessons

PRACTISE makes you PERFECT ; ; ; There is no SUBSTITUTE for HARD WORK ;;;;Breathe SUCCESS like OXYGEN
Proper Planning ( reg what portions to be covered today) revising today's class portions & clarifying doubts solving Maths problems regularly ,noting down formulae separately trying to understand...

Static and dynamic libraries
A library is a package of code that is meant to be reused by many programs. A static library (also known as an archive) consists of routines that are compiled and linked directly into your program. When...

Do You Know How Is Size Of Structure Defined?
Size of the structure is defined based on multiplies of bigger data type member in the structure. Example: If a structure contains integer, char, short data type, then size of the Structure will be multiples...

What is a Programming Language
What is a Language? Language is a communication system of human. What is a programming Language? A programming Language is a formal constructed language design to communicate...

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...

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 >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

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