Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


How to change constant values?

Answers were Sorted based on User's Feedback



How to change constant values?..

Answer / ravi

Make it as mutable

Is This Answer Correct ?    14 Yes 3 No

How to change constant values?..

Answer / udit

const int var=10;
*(int *)&var=20;
this syntex change the constat value

Is This Answer Correct ?    15 Yes 10 No

How to change constant values?..

Answer / rajesh

use const_cast<...>

Is This Answer Correct ?    6 Yes 2 No

How to change constant values?..

Answer / ravi

can't change untill recomile

Is This Answer Correct ?    0 Yes 1 No

How to change constant values?..

Answer / asif karim

#include <stdio.h>
#include<iostream>
using namespace std;

void main()
{
const int var=10;
int a;
a=*(int* )& var=20;
cout<<a;
}

Is This Answer Correct ?    3 Yes 10 No

How to change constant values?..

Answer / edward

you can't change

Is This Answer Correct ?    5 Yes 13 No

Post New Answer

More C++ General Interview Questions

Explain register storage specifier.

0 Answers  


What are advantages of c++?

0 Answers  


Can we use pointers in c++?

0 Answers  


When do we run a shell in the unix system?

0 Answers  


When should you use multiple inheritance?

2 Answers  






Explain polymorphism?

0 Answers  


Why was c++ created?

0 Answers  


Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.

0 Answers  


What is an opaque pointer?

1 Answers  


What kind of jobs can I get with c++?

0 Answers  


Why is c++ called oops?

0 Answers  


Why do we use pointers in c++?

0 Answers  


Categories