Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to change constant values?

Answers were Sorted based on User's Feedback



How to change constant values?..

Answer / ravi

Make it as mutable

Is This Answer Correct ?    14 Yes 3 No

How to change constant values?..

Answer / udit

const int var=10;
*(int *)&var=20;
this syntex change the constat value

Is This Answer Correct ?    15 Yes 10 No

How to change constant values?..

Answer / rajesh

use const_cast<...>

Is This Answer Correct ?    6 Yes 2 No

How to change constant values?..

Answer / ravi

can't change untill recomile

Is This Answer Correct ?    0 Yes 1 No

How to change constant values?..

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

How to change constant values?..

Answer / edward

you can't change

Is This Answer Correct ?    5 Yes 13 No

Post New Answer

More C++ General Interview Questions

Can turbo c++ run c program?

0 Answers  


Describe new operator?

0 Answers  


Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.

0 Answers  


What are maps in c++?

0 Answers  


Can a new be used in place of old mallocq? If yes, why?

0 Answers  


Write a struct time where integer m, h, s are its members?

0 Answers  


What are the extraction and insertion operators in c++? Explain with examples.

0 Answers  


What type of question are asked in GE code writing test based on c++ data structures and pointers?

0 Answers  


Can a constructor throw a exception? How to handle the error when the constructor fails?

1 Answers  


List the issue that the auto_ptr object handles?

0 Answers  


What is c++ hash?

0 Answers  


Why is it necessary to use a reference in the argument to the copy constructor?

0 Answers  


Categories