LP*

This is a discussion on LP* within the C++ Programming forums, part of the General Programming Boards category; What does LP* in front of typedef mean? Long pointer? For instance: OVERLAPPED -> LPOVERLAPPED DWORD -> LPDWORD...

  1. #1
    l2u
    l2u is offline
    Registered User
    Join Date
    May 2006
    Posts
    630

    LP*

    What does LP* in front of typedef mean? Long pointer?
    For instance:
    OVERLAPPED -> LPOVERLAPPED
    DWORD -> LPDWORD

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    Yep, exactly. As opposed to SP for short pointer. The distinction was necessary in 16-bit Windows. Nowadays they're all the same.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    l2u
    l2u is offline
    Registered User
    Join Date
    May 2006
    Posts
    630
    So you can just (better) use *DWORD instead of LPDWORD?

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    They are equivalent, yes. Whether you prefer one or the other is a matter of taste. I prefer the proper pointer over the typedef. I've seen people (including me) forgetting that LPDWORD is a pointer too often.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    l2u
    l2u is offline
    Registered User
    Join Date
    May 2006
    Posts
    630
    Thank you.

Popular pages Recent additions subscribe to a feed

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