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 class and structure in c++?
What is lambda in c++?
Define stacks. Provide an example where they are useful.
What is the most powerful coding language?
Do we have to use initialization list in spite of the assignment in constructors?
Why do we need constructors in c++?
How is modularity introduced in C++?
What is overloading unary operator?
What are mutator methods in c++?
What is c++ best used for?
Is dev c++ free?
When one must use recursion function? Mention what happens when recursion functions are declared inline?