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

What is multithreading and what is its use?Whats are multithreading techniques used in C++?

1 Answers  


Is C++ case sensitive a) False b) Depends on implementation c) True

0 Answers  


What problems might the following macro bring to the application?

0 Answers  


Can we use resume in error handling i.e. in the catch block

5 Answers   Infosys,


Explain the properties and principles of oop.

0 Answers  


Explain queue. How it can be implemented?

0 Answers  


Write any small program that will compile in "C" but not in "C++"

10 Answers   Honeywell,


Why is main function important?

0 Answers  


When should overload new operator on a global basis or a class basis?

0 Answers  


What are the basics of local (auto) objects?

0 Answers  


What is the this pointer?

0 Answers  


How new/delete differs from malloc()/free?

0 Answers  


Categories