Viewing 4 reply threads
  • Author
    Posts
    • #9150
      AvatarSideeq
      Participant
        Up
        0
        Down
        ::

        One area I’ve had difficulty with in the past is “reading” lines of source. I came across a website called cdecl: C gibberish <-> English ( https:// cdecl . org ) a few years back and promptly forgot about it. “Reading” lines of code contained in the first week preparation, jolted a faint memory, and I found it again after a Google search. I was hoping I could your opinion on the accuracy of translations and ask if there are any additional resources on this “reading” lines of source correctly. Perhaps it might be of use, to have a dedicated Topic for posting such questions to check for accuracy as we progress through the course?

        Below is an example of what I mean by “read” (taken from the website above):

        Sample Input-
        char * const (*(* const bar)[5])(int )

        Sample Output-
        declare bar as const pointer to array 5 of pointer to function (int) returning const pointer to char

        Thanks!

      • #9152
        RainerRainer
        Keymaster
          Up
          1
          Down
          ::

          I don’t know any resource. I try to be as exact and consistent as possible. If I find one, I will add it to further information.

          This topic is extremely important when we talk about “const pointers to const ints”, or discuss template parameters, template arguments, and function arguments.

        • #9162
          AvatarTobias
          Participant
            Up
            3
            Down
            ::

            There is a handy rule that works quite fine for me, perhaps you also get along with it.

            http://c-faq.com/decl/spiral.anderson.html

          • #9163
            RainerRainer
            Participant
              Up
              1
              Down
              ::

              Thanks for your rule. I’m happy that code is often not so complicated in modern C++.

            • #9976
              Avatarbhaumik.k.shah
              Participant
                Up
                0
                Down
                ::

                This can be very useful. Thanks @Sideeq

            Viewing 4 reply threads
            • You must be logged in to reply to this topic.