How to change constant values?
Answers were Sorted based on User's Feedback
Answer / udit
const int var=10;
*(int *)&var=20;
this syntex change the constat value
| Is This Answer Correct ? | 15 Yes | 10 No |
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 |
Is c++ a programming language?
What do nonglobal variables default to a) auto b) register c) static
What will i and j equal after the code below is executed? Explain your answer.
Search for: what is pair in c++?
What do you mean by Stack unwinding?
What is decltype c++?
What happens if an exception is throws from an, object's constructor and object's destructor?
Are php strings immutable?
What is the difference between mutex and binary semaphore?
What are Binay tress and B trees? Diff between them?
write the code that display the format just like 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 6 5 4 3 2 1
What is iterator in c++?