|
by: Shailesh |
last post by:
One problem I've been wrestling with for a long time is how to use the
C++ integral data types, vis-a-vis their size. The C++ rules
guarantee that a char is at least 1 bytes, a short and int at least 2
bytes, and a long at least 4 bytes. The rules also define a size
precedence to the types. In Stroustrup's book, it says that all type
sizes are multiples of char, "so by definition the size of a char is
1." According to the rules, that...
|
by: bilbothebagginsbab5 AT freenet DOT de |
last post by:
Hello, hello.
So. I've read what I could find on google(groups) for this, also the faq of
comp.lang.c.
But still I do not understand why there is not standard method to "(...)
query the malloc package to find out how big an allocated block is". (
Question 7.27)
Is there somwhere explained why - because it would seem to me, that free()
|
by: puzzlecracker |
last post by:
Got Confused on the interview with memory alligment questions... PLEASE
HELP -- How much bytes of memory will structs below take on 32 bit
machine? What about 64 bit machine? Why is it different? (if it's
relevent, use standard size of datatypes)
a)
Code:
struct
|
by: Sunil |
last post by:
Hi all,
I am using gcc compiler in linux.I compiled a small program
int main()
{
printf("char : %d\n",sizeof(char));
printf("unsigned char : %d\n",sizeof(unsigned char));
printf("short : %d\n",sizeof(short));
printf("unsigned short : %d\n",sizeof(unsigned short));
printf("int : %d\n",sizeof(int));
|
by: siliconwafer |
last post by:
Who decides size of data types in C?
Is it the:
1.C standard and hence the compilers
2.Operating System.
|
|
by: Neil Zanella |
last post by:
Hello all,
In C and C++ a primitive data type is represented by a minimum number
of bits as defined by the corresponding standard. For instance an int
is assumed to be at least 16 bits on all platform where in practice
an int is 16 bits on the arcane 16 bit machines and 32 bits on the
most commonly used 32 bit machines.
However, my C# reference says that an int in C# is always 32 bits wide.
It also specifies a specific number of bits...
|
by: Roy |
last post by:
I have an object with array of some data types. How do I get the number of
bytes for it in managed code? The underlying data types could be primitive
types or userdefined structures.
For example I have an integer array boxed in object.
|
by: subramanian100in |
last post by:
Given that the sizes of pointers to different data types(built-in or
structures) can be different, though malloc returns a void *, it is
assigned to any pointer type. The language allows it. From this, can I
conclude that the size of (void *) should be the maximum ?
If this is not the case, consider the following scenario.
Suppose there is a type T (built-in or structure) whose pointer size
is bigger than the sizeof (void *) ie sizeof (T...
|
by: rao |
last post by:
On some of the compilers integer size is 2 and on some other it is 4
bytes.
My doubt is who decides the size of the integer?
is it plainly the compiler?
Does OS or Processor also has any control in deciding the size of such
data types?
|
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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
|
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: 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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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.
|