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 |
Search for: what is pair in c++?
What is a Default constructor?
Differentiate between a copy constructor and an overloaded assignment operator.
What is a storage class?
5. Can inline functions have a recursion?
Give 2 examples of a code optimization?
How do you master coding?
How to reduce a final size of executable?
Explain the benefits of proper inheritance.
What are enumerations?
What are the techniques you use for debugging?
Explain calling an object's member function(declared virtual)from its constructor?