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 |
What is a .lib file in c++?
What is your strongest programming language (Java, ASP, C, C++, VB, HTML,C#, etc.)?
24 Answers Infosys, Microsoft, TCS,
How do you initialize a string in c++?
Difference between a homogeneous and a heterogeneous container
What is linked list in c++?
Are php strings immutable?
What is the difference between *p++ and (*p)++ ?
Why we use #include conio h in c++?
What is the this pointer?
Which sort does c++ use?
Difference between inline functions and macros?
What is public, protected, private in c++?