#pragma pack(push,bitmap_data,1) ?

This is a discussion on #pragma pack(push,bitmap_data,1) ? within the C++ Programming forums, part of the General Programming Boards category; I have a bitmap loader with... Code: #pragma pack(push,bitmap_data,1) *a few structures relating to the bitmap header files and rgbquad* ...

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    34

    #pragma pack(push,bitmap_data,1) ?

    I have a bitmap loader with...



    Code:
    #pragma pack(push,bitmap_data,1)
    
    
    *a few structures relating to the bitmap header files and rgbquad*
    
    
    #pragma pack(pop,bitmap_data)

    but what does the #pragman pack thing do?

    Many thanks

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    It tells the compiler that it should not "pad" the data structures within that section (or actually, it should "pad" to a boundary of 1, but as that is the smallest addressable unit of the processor, most likely, that will amount to nothing).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    34
    cheers mat

  4. #4
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    http://msdn.microsoft.com/en-ca/library/2e70t5y1.aspx

    If you have further questions about some of your Visual Studio compiler features, you can find all your answer there.

    Note that pragma directives are compiler specific.
    I hate real numbers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. labels inside the code #pragma mark label
    By nacho4d in forum C++ Programming
    Replies: 6
    Last Post: 01-11-2009, 01:50 AM
  2. Programming a PIC 16F84 microcontroller in C
    By Iahim in forum C Programming
    Replies: 1
    Last Post: 05-13-2004, 02:23 PM
  3. what does #pragma do?
    By cbc in forum C++ Programming
    Replies: 2
    Last Post: 10-16-2003, 06:51 AM
  4. #pragma ?
    By dat in forum C++ Programming
    Replies: 2
    Last Post: 04-02-2003, 07:14 AM
  5. what is a pragma comment?
    By Shadow12345 in forum C++ Programming
    Replies: 9
    Last Post: 11-25-2002, 04:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21