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 |
Do you need a main function in c++?
What is the use of vtable?
What is rtti in c++?
What is the difference between multiple and multilevel inheritance in c++?
Why use of template is better than a base class?
What is stream and its types in c++?
What is #include sstream?
What and all can a compiler provides by default?
In which memory a class gets stored(in heap /in stack)? And why??
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
What is a storage class in C++