How to access or modify the const variable in c ?

Answer Posted / sri harsha s

Its compiler dependant.
Using pointer you can modify the content of a 'const'
variable. It works in gcc.. you will get the following
warning when you compile that program.

warning: initialization discards qualifiers from pointer
target type.

I am not sure about turbo c++.

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sorting in c plus plus?

755


how to write optimum code to divide a 50 digit number with a 25 digit number??

3024


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1968


Explain can you assign a different address to an array tag?

866


Why C language is a procedural language?

820


If you know then define #pragma?

887


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

1932


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5723


When should I declare a function?

833


What does != Mean in c?

812


any "C" function by default returns an a) int value b) float value c) char value d) a & b

879


What are Macros? What are its advantages and disadvantages?

882


What is table lookup in c?

855


Why is c called a mid-level programming language?

967


Why are algorithms important in c program?

860