UrbanPro

Learn C Language from the Best Tutors

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

Search in

What are 'macros' and 'constants' used for in C?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

Experienced Computer trainer having worked in IT sector for 20 years.

The const keyword causes the identifier size to be allocated in the read-only memory. This means that the value of the identifier can not be changed by the executing program. MACROS are efficient than the const statements as they are not given any memory, being more Readable and Faster in execution!
Comments

+46-768394959 (Whatsapp number) please reach me on this number

Macros: Macros are defined using the #define preprocessor directive. They are not variables; instead, they are symbolic constants. Macros are replaced by their values at compile-time through a process called macro expansion. Macros can include code and perform text substitution. They are processed...
read more

Macros:

  • Macros are defined using the #define preprocessor directive. They are not variables; instead, they are symbolic constants.
  • Macros are replaced by their values at compile-time through a process called macro expansion.
  • Macros can include code and perform text substitution. They are processed by the preprocessor before the actual compilation of the code.
  • Macros can be used to create reusable code snippets, conditional compilation, or to define constants with complex expressions.

    Constants:

    • Constants are variables that are declared as read-only, and their values cannot be changed during the program's execution.
    • In C, you can define constants using the const keyword. These are typically used for values that should not change throughout the program.
    • Constants are stored in memory, and their values are accessed like regular variables.
read less
Comments

Related Questions

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
What is the error in the given C language program?
There are three types of errors exist in C Programming: Syntax errors, Semantic errors and runtime errors.
Suresh
0 0
5
What is meant by “enum” in C?
An enum is a keyword in C language, it is an user defined data type. All properties of integer are applied on Enumeration data type It work like the Integer.
Geetanjali
What is C? Where it is used ?
C has the advantage that it is a relatively small language, which makes it easy to implement a C compiler (whereas a C++ compiler is a monster to write), and makes it easier to learn the language. C...
Chandi

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

Ask a Question

Related Lessons

Structures in C
A structure is a collection of one or more data members possibly of different data types, grouped together under a single name for convenient handling. Defining a Structure: In general terms,...

C Program-String Palindrome
//Header files #include<stdio.h>#include<conio.h>#include<string.h> //Main function void main(){ char mystring; int i,length; int flag=0; //Function for clearing screen clrscr();...

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

How do i get best Campus / Off Campus Placement?
Companies are looking for Skilled Freshers. So build your technical skills while doing MCA / BTech / BCA / BSc (IT or CS) into below areas- 1. Strong your programming & debugging skills ...

Java and C trainer
Always think any conspect with real-time example like Object -- object must have states and behaviour then only we will call that thing is Object like fan is Object (rotating,color)

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 >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

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