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 |
Can turbo c++ run c program?
Describe new operator?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
What are maps in c++?
Can a new be used in place of old mallocq? If yes, why?
Write a struct time where integer m, h, s are its members?
What are the extraction and insertion operators in c++? Explain with examples.
What type of question are asked in GE code writing test based on c++ data structures and pointers?
Can a constructor throw a exception? How to handle the error when the constructor fails?
List the issue that the auto_ptr object handles?
What is c++ hash?
Why is it necessary to use a reference in the argument to the copy constructor?