answersLogoWhite

0

Macros are processed at preprocessing time where as constant variables are processed at complie time. Macros doesnot have any scope but constant variables has scope. Macros doesnot have the type checking where as constant variables have type checking.

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
More answers

program veriable is a simple veriable of any program its value can be change or modify in future but if we have any constant in our program we cannot change its value we can only use it in increment & decrement and contatant value(fixed value)

e.g : if we have two variable a and b a is constant and b is simple variable

we can use like that:

constant int a=10;

int b=20;

we can change b's value like b=30;

Not like that a=20; its will give error in you program

we can increment or decrement it like a++;a--;

not have other difference b/w them

User Avatar

Wiki User

13y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between macros and constant variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the differences between a global variable and macro?

A global variable is a place of data storage which multiple modules of application (sometimes all modules) can access to read and modify the variable's content. A macro is something altogether different. A macro is a set of instructions, typically used to save keystrokes when coding, and to maintain code readability. While macros can reference, declare or use variables (including global variables), macros and variables are quite different and cannot be compared.


What is the expansion of conio.h?

EXPANSION OF CONIO.HConio.h library in C implies a console version which encapsulates the common I/O functions.Console input/output header


What is the difference between a macro and typedef?

A Macro is a preprocessor directive means that before compilation the macros are replaced. Where as typedef is defining a new data type which is same as the existing data type. Syntax: typedef Existing datatype New datatype For example typedef int NUMBER; Here NUMBER (New datatype)is defined as a data type which contains the properties same as int(Existing datatype). You can declare a variable of int as NUMBER a; is same as int a; similarly typedef int* NUMBERPOINTER; NUMBERPOINTER a; Here a is a pointer of integer type.


What is difference between macro processor and macro assembler?

A macro processor processes macros. So what do you think a macro call does, play the flute. The answer is in the question and that begs the question of are you suited to computer programming specifically and an education in general. You are showing a marked reluctance to thinking.


Macros and function are related in what aspect?

varying no of arguments