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 |
Where are setjmp and longjmp used in c++?
How the endl and setw manipulator works?
what is scupper?
How do I run c++?
write a C++ programming using for loop: * * * * * * * * * *
Which operations are permitted on pointers?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
When should overload new operator on a global basis or a class basis?
How do I write a c++ program?
What is the arrow operator in c++?
What is buffering in c++?
Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1