by: drowned |
last post by:
all right, check it out... I've got a practice exercise from "thinking
in c++" whose answer isn't covered in the annotated solutions guide,
so I'm trying to handle it, but I don't understand what...
|
by: R. Anbeeswaran |
last post by:
Hi All,
void main()
{
const int i = 20;
int *p = const_cast<int*>(&i);
*p = 40;
cout <<"i="<< i <<"\t"<<"*p="<<*p<<"\n";
}
|
by: S.Senthilvel |
last post by:
hi,
I am a little confused about the const_cast.I've thought it this way till
now.
//Proper cast
int i = 10;
const int* pci = &i;
int *pi = const_cast<int*>(pci);
|
by: johny smith |
last post by:
Can someone please give me some good reference site/information for
understanding when and why I would use
1.) const_cast
Don't know why you would do this?
2.) reinterpret_cast.
I have used...
|
by: AlesD |
last post by:
Hello,
I can't figure out how to build assignment operator for class which
contains "type* const value".
--- example ---
class parent_t;
class child_t {
|
by: CoolPint |
last post by:
While I was reading about const_cast, I got curious and wanted to know
if I could modify a constant variable through a pointer which has been
"const_cast"ed. Since the pointer would be pointing to...
|
by: Simon Bailey |
last post by:
In the following code at the end of the program z = 20 & y = 99.
void doit(const int* x)
{
int* nonconst;
nonconst = const_cast<int*>(x);
*nonconst = 99;
}
int main(int argc, char* argv)
|
by: Alexander Stippler |
last post by:
Hello,
I wonder if and in what cases casting const away by a const_cast can be
dangerous. In one place the only way I can imagine to realize a pretty
nice feature is casting away const. Now I...
|
by: Squeamizh |
last post by:
class my_class {
public:
my_class() : value(0) { }
int& get_value() { return value; }
const int& get_value() const {
my_class& c = const_cast<my_class&>(*this);
return c.get_value();
}
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|