How to define a variable as read-only in C language?

Status
Not open for further replies.

desaipa

Member level 2
Joined
Jan 20, 2005
Messages
53
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
india
Activity points
487
need help about c

plz can any one tell how to define a veriable as read only in c programming
 

Re: need help about c

hi

when a variable is declared as int char or float, it can change values.

but when u add "const" to any of them they r not going to change value if initilized.
 

Re: need help about c

Using "const" keyword you can perfom read only operation. Bcoz once initialized its value won't changes
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…