473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Difference between #pragma pack() and #pragma pack(n)

1
I want to know the difference between #pragma pack() and #pragma pack(n)
If the there is no argument in pack () then what is alignment?
Jun 18 '15 #1
1 1514
donbock
2,426 Expert 2GB
The purpose of #pragma is to trigger implementation-dependent behavior. Your question cannot be answered without knowing which C compiler you are using.
Jun 18 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JustSomeGuy | last post by:
I need to define a structure that is byte packed. I was planning on using #pragma pack (1) So when does the pragma pack end right after the first structure definition or at the end of the...
9
by: Giovanni Bajo | last post by:
Hello, with Visual Studio .NET 2003: __declspec(align(1)) struct X { unsigned int x : 3; unsigned int y : 13; };
1
by: Mike Margerum | last post by:
I seem to be running into an issue where I am deriving a new class from a struct with a different alignemnt via the pragma pack #pragma pack(1) typedef struct { unsigned short a; unsigned...
15
by: Daniel Rudy | last post by:
What is the difference between packed and unpacked structs? -- Daniel Rudy Email address has been base64 encoded to reduce spam Decode email address using b64decode or uudecode -m Why...
3
by: Jimmy | last post by:
Struct definition as following(on 32-bit Linux): #pragma pack(push, 8) struct MY_STRUCT { char a; short b; short c; short d; int e;
26
by: Rick | last post by:
I'm told that "#pragma once" has made it into the ISO standard for either C or C++. I can't find any reference to that anywhere. If it's true, do any of you have a reference I can use? ...
6
by: Boltar | last post by:
If I use #pragma pack to byte align structures to non word size , will this cause the program to run slightly slower if it is accessing and setting non word aligned integers etc in the struct? Is...
4
by: Steven Woody | last post by:
In our project, one used the following struct #pragma pack(1) struct Foo { uint8_t b1; uint8_t b2; uint8_t b3; std::vector<uint8_t buf; ... };
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
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,...
0
jinu1996
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...
0
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...
0
tracyyun
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.