Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. syntax error [modified]

syntax error [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
9 Posts 2 Posters 0 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.
  • R Offline
    R Offline
    rupeshkp728
    wrote on last edited by
    #1

    I am getting the following error: error C2143: syntax error : missing ')' before '&' on building the below code:

    typedef unsigned int uint4;
    void Find(uint4& a, uint4 b, uint4 c);
    void Find(uint4& a, uint4 b, uint4 c)
    {
    . . . .
    }

    I do not see any error in code. Any idea as to why this error is coming up?

    modified on Tuesday, April 6, 2010 4:40 AM

    C 2 Replies Last reply
    0
    • R rupeshkp728

      I am getting the following error: error C2143: syntax error : missing ')' before '&' on building the below code:

      typedef unsigned int uint4;
      void Find(uint4& a, uint4 b, uint4 c);
      void Find(uint4& a, uint4 b, uint4 c)
      {
      . . . .
      }

      I do not see any error in code. Any idea as to why this error is coming up?

      modified on Tuesday, April 6, 2010 4:40 AM

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      void Find(uint4& a, uint4 b, uint4 c,);
      ^

      What's the purpose of that comma? :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      R 1 Reply Last reply
      0
      • C CPallini

        void Find(uint4& a, uint4 b, uint4 c,);
        ^

        What's the purpose of that comma? :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        R Offline
        R Offline
        rupeshkp728
        wrote on last edited by
        #3

        sorry thats a typing mistake here

        1 Reply Last reply
        0
        • R rupeshkp728

          I am getting the following error: error C2143: syntax error : missing ')' before '&' on building the below code:

          typedef unsigned int uint4;
          void Find(uint4& a, uint4 b, uint4 c);
          void Find(uint4& a, uint4 b, uint4 c)
          {
          . . . .
          }

          I do not see any error in code. Any idea as to why this error is coming up?

          modified on Tuesday, April 6, 2010 4:40 AM

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          Your code compiles fine with my C++ compiler (are you using a C compiler?). :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          R 1 Reply Last reply
          0
          • C CPallini

            Your code compiles fine with my C++ compiler (are you using a C compiler?). :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            R Offline
            R Offline
            rupeshkp728
            wrote on last edited by
            #5

            yes I guess how to find that in visual studio I have written the code in a .cpp file

            C 1 Reply Last reply
            0
            • R rupeshkp728

              yes I guess how to find that in visual studio I have written the code in a .cpp file

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              .cpp source files are compiled (by default) with the C++ compiler. However, the default behaviour may be overriden by the /TC compiler option, see [^]. :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              R 1 Reply Last reply
              0
              • C CPallini

                .cpp source files are compiled (by default) with the C++ compiler. However, the default behaviour may be overriden by the /TC compiler option, see [^]. :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                R Offline
                R Offline
                rupeshkp728
                wrote on last edited by
                #7

                Thanks Pallini for the inputs. I think I have got the bug. Actually in the VC project the file where I had been calling the fn. is .cpp while I have define it in a .c file. I guess this may be the problem.

                C 1 Reply Last reply
                0
                • R rupeshkp728

                  Thanks Pallini for the inputs. I think I have got the bug. Actually in the VC project the file where I had been calling the fn. is .cpp while I have define it in a .c file. I guess this may be the problem.

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #8

                  rupeshkp728 wrote:

                  Actually in the VC project the file where I had been calling the fn. is .cpp while I have define it in a .c file. I guess this may be the problem.

                  Please note you cannot use references (e.g. 'uint4 &' as your function's parameter) in C language. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  R 1 Reply Last reply
                  0
                  • C CPallini

                    rupeshkp728 wrote:

                    Actually in the VC project the file where I had been calling the fn. is .cpp while I have define it in a .c file. I guess this may be the problem.

                    Please note you cannot use references (e.g. 'uint4 &' as your function's parameter) in C language. :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    R Offline
                    R Offline
                    rupeshkp728
                    wrote on last edited by
                    #9

                    yes I have changed the file name to .cpp

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups