|
by: Jamie Burns |
last post by:
Hello,
I am writing a client / server application. There is 1 server, and many
clients. The server processes requests from each client, and typically
creates and manipulates C++ objects on their behalf.
Now, when a client requests for an object to be created, I pass back a
pointer to the object (from server memory address scope) as a "long
integer". To the client, this is just an ID for the object they wish to
access. From then on,...
|
by: Martin |
last post by:
Two questions relating to FAQ answer 12.42.
(1) In the statement
s.i16 |= (unsigned)(getc(fp) << 8);
i16 is declared int. The reason for casting to (unsigned) is explained as
guarding against sign extension. But left-shifting will always fill vacated
bits with zero (assuming the right operand is nonnegative and less than the
number of bits in the left expression's type). So how is the cast useful?
|
by: Nicolas Blais |
last post by:
Hi,
I have this following class which I use as a timer:
#include <sys/time.h>
using namespace std;
class chrono {
public:
chrono() {};
|
by: jeff |
last post by:
unsigned long a = ...;
long b = (long)a;
while a overflows, what is the result of b?
Thank you.
|
by: Ralf |
last post by:
If you want to explicitly state the type of an integer constant, you
basically have two options. Either you use an explicit cast, as in:
(unsigned int) 1234
or you use the UL suffixes, as in:
1234UL
Are there -- in general -- any semantic differences in using casts
versus suffixes?
--Ralf
|
|
by: cdg |
last post by:
I am trying to write a section of code that uses a worker thread and
would need a "post message" to post a
"long" integer to the receiving function. However, I am not sure how to
write the cast for the "long" int. Apparently,
the "long" needs to be a pointer since the thread was passed the "this"
pointer for the main dialog. And the "long" is declared in the main dialog
class. If it is declared as a local variable, there is an Assertion...
|
by: Joe |
last post by:
I need to cast the correct way
HMENU mymenu;
int stuff;
....
stuff=(int)(long)(HMENU)mymenu;
....
|
by: Felix Kater |
last post by:
I haven't been thinking about it for years but recently I've stumbled on
the fact that 'casting' is actually doing (at least) two different
things:
On the one hand 'casting' means: 'Change something into somthing
else'. Example: double d=9.99; long l=(double)d;
On the other hand 'casting' means: 'Treating something as something
else without change'. For instance when casting function pointers.
|
by: aaragon |
last post by:
Hi everyone,
I wrote a very simple function to try to understand the casting of
variables in C++. The function is
function foo()
{
std::vector<inttest(100);
randomize(test);
unsigned long x = 0;
|
by: ManicQin |
last post by:
Hi, I've browsed the STL code a bit and stumble upon the next line (in
the operator << overload of both long and short outputs - the line is
for checking does the input is a manipulator)
long _Tmp = (_Bfl == ios_base::oct || _Bfl == ios_base::hex)
? (long)(unsigned short)_Val //<-This Line
: (long)_Val;
Is there any profound reason why they "Double" casting the _Val?
Thanks.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|