Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. What parentheses at the beginning mean?
Qt 6.11 is out! See what's new in the release blog

What parentheses at the beginning mean?

Scheduled Pinned Locked Moved Solved C++ Gurus
4 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by
    #1

    Recently i faced some strange thing in examples of other people, this thing i don't remember in any book of c++ i've read, or tutuorials. Parentheses at the very beginning, what is that and how such thing named?

    (LPVOID)variableName
    
    K 1 Reply Last reply
    0
    • EngelardE Engelard

      Recently i faced some strange thing in examples of other people, this thing i don't remember in any book of c++ i've read, or tutuorials. Parentheses at the very beginning, what is that and how such thing named?

      (LPVOID)variableName
      
      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Engelard

      I guess that this is a long pointer and the variable is not used further?

      It should have the same effect as

      Q_UNUSED(VariableName);
      

      Sometimes you may have an extra parameter in a parameter list which will trigger a complaint from compiler. In both cases you clarify to the compiler that you are aware of this. See Q_UNUSED

      Vote the answer(s) that helped you to solve your issue(s)

      EngelardE 1 Reply Last reply
      0
      • K koahnig

        @Engelard

        I guess that this is a long pointer and the variable is not used further?

        It should have the same effect as

        Q_UNUSED(VariableName);
        

        Sometimes you may have an extra parameter in a parameter list which will trigger a complaint from compiler. In both cases you clarify to the compiler that you are aware of this. See Q_UNUSED

        EngelardE Offline
        EngelardE Offline
        Engelard
        wrote on last edited by
        #3

        @koahnig definitely not. I was using such variables further(or what point of that var then), as i presumed - this work like some kind of conversion or so. I adding (TCHAR) or some other stuff before(from examples of others) and in that place variable converted to TCHAR.

        But i might be wrong, thats why i'm asking here.

        K 1 Reply Last reply
        0
        • EngelardE Engelard

          @koahnig definitely not. I was using such variables further(or what point of that var then), as i presumed - this work like some kind of conversion or so. I adding (TCHAR) or some other stuff before(from examples of others) and in that place variable converted to TCHAR.

          But i might be wrong, thats why i'm asking here.

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @Engelard

          It is a C-style cast to an unspecified long pointer. When some more is around in the line you are casting to your needs.

          As you show it above you get rid of compile warnings.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          5

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved