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. help

help

Scheduled Pinned Locked Moved C / C++ / MFC
help
21 Posts 7 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.
  • Y Offline
    Y Offline
    youbo
    wrote on last edited by
    #1

    #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<

    M R H D 4 Replies Last reply
    0
    • Y youbo

      #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      oo or OO ?


      Maximilien Lincourt Your Head A Splode - Strong Bad

      1 Reply Last reply
      0
      • Y youbo

        #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<

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

        ;P


        Russell

        Y 1 Reply Last reply
        0
        • R Russell

          ;P


          Russell

          Y Offline
          Y Offline
          youbo
          wrote on last edited by
          #4

          they are the same maybe...

          R 1 Reply Last reply
          0
          • Y youbo

            #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            Did you compile this code?

            Y 1 Reply Last reply
            0
            • H Hamid Taebi

              Did you compile this code?

              Y Offline
              Y Offline
              youbo
              wrote on last edited by
              #6

              yes, but it have two errors,and i couldn't find them

              M R 2 Replies Last reply
              0
              • Y youbo

                they are the same maybe...

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

                Little tips for coding: 1) use longer names for varaibles and functions (this helps to understand what the code do) 2) do not use goto :omg:... find other ways when possible: in your case you can return -1; or something similar :-D


                Russell

                R 1 Reply Last reply
                0
                • Y youbo

                  yes, but it have two errors,and i couldn't find them

                  M Offline
                  M Offline
                  Maximilien
                  wrote on last edited by
                  #8

                  What were the errors ? and on what line ?


                  Maximilien Lincourt Your Head A Splode - Strong Bad

                  Y 1 Reply Last reply
                  0
                  • Y youbo

                    yes, but it have two errors,and i couldn't find them

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

                    Do what Maximilien suggested. replace every oo with OO!:-D


                    Russell

                    1 Reply Last reply
                    0
                    • M Maximilien

                      What were the errors ? and on what line ?


                      Maximilien Lincourt Your Head A Splode - Strong Bad

                      Y Offline
                      Y Offline
                      youbo
                      wrote on last edited by
                      #10

                      it is the new code changed by me follow,but it also have one error. #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); cout<

                      R D 2 Replies Last reply
                      0
                      • Y youbo

                        it is the new code changed by me follow,but it also have one error. #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); cout<

                        R Offline
                        R Offline
                        Russell
                        wrote on last edited by
                        #11

                        youbo wrote:

                        unexpected end of file found

                        then complete this line #include "???????" as #include "stdafx.h" and check the parentesis {}


                        Russell

                        1 Reply Last reply
                        0
                        • Y youbo

                          #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<

                          D Offline
                          D Offline
                          David Crow
                          wrote on last edited by
                          #12

                          youbo wrote:

                          };where is the error...

                          The "error" is that you did not use the debugger.


                          "A good athlete is the result of a good and worthy opponent." - David Crow

                          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                          1 Reply Last reply
                          0
                          • Y youbo

                            it is the new code changed by me follow,but it also have one error. #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); cout<

                            D Offline
                            D Offline
                            David Crow
                            wrote on last edited by
                            #13

                            youbo wrote:

                            the error is :fatal error C1004: unexpected end of file found

                            See here. Had you used <pre> tags, and proper indentation, you could have quickly seen the error:

                            using namespace std;

                            int oo(int m);

                            int sum=0;

                            void main()
                            {
                            int m;
                            cin>>m;

                            oo(m);
                            
                            cout<Once you address the C1004 error, you'll still be presented with a LNK2001 error, however.  And to top it all off, a stack overflow is imminent. 
                            

                            "A good athlete is the result of a good and worthy opponent." - David Crow

                            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                            1 Reply Last reply
                            0
                            • R Russell

                              Little tips for coding: 1) use longer names for varaibles and functions (this helps to understand what the code do) 2) do not use goto :omg:... find other ways when possible: in your case you can return -1; or something similar :-D


                              Russell

                              R Offline
                              R Offline
                              Roger Broomfield
                              wrote on last edited by
                              #14

                              having been brought up from coding raw hex on an 8080 SDK through Assembler and on into C and C++ I have no qualms about using goto. goto is after all just a JMP return -1 is also a JMP. break is also a JMP. why are you threatened by goto?

                              D R R 3 Replies Last reply
                              0
                              • R Roger Broomfield

                                having been brought up from coding raw hex on an 8080 SDK through Assembler and on into C and C++ I have no qualms about using goto. goto is after all just a JMP return -1 is also a JMP. break is also a JMP. why are you threatened by goto?

                                D Offline
                                D Offline
                                David Crow
                                wrote on last edited by
                                #15

                                Because you don't goto the middle of another function.


                                "A good athlete is the result of a good and worthy opponent." - David Crow

                                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                                R 1 Reply Last reply
                                0
                                • R Roger Broomfield

                                  having been brought up from coding raw hex on an 8080 SDK through Assembler and on into C and C++ I have no qualms about using goto. goto is after all just a JMP return -1 is also a JMP. break is also a JMP. why are you threatened by goto?

                                  R Offline
                                  R Offline
                                  Russell
                                  wrote on last edited by
                                  #16

                                  I wrote "....when possible..." ;) It is a bad pratique (for me). It is demonstrated that we can do everything without the use that keyword. Of course I use it (sometimes)....but I'm not a newbie like him:-D First you have to learn how make addictions by hand....and after that you can use the calculator:) :rose:


                                  Russell

                                  1 Reply Last reply
                                  0
                                  • D David Crow

                                    Because you don't goto the middle of another function.


                                    "A good athlete is the result of a good and worthy opponent." - David Crow

                                    "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                                    R Offline
                                    R Offline
                                    Roger Broomfield
                                    wrote on last edited by
                                    #17

                                    obviously you have never disassembled BIOS. JMPing into the middle of functions is common practice in every BIOS I have ever disassembled.

                                    R D 2 Replies Last reply
                                    0
                                    • R Roger Broomfield

                                      obviously you have never disassembled BIOS. JMPing into the middle of functions is common practice in every BIOS I have ever disassembled.

                                      R Offline
                                      R Offline
                                      Russell
                                      wrote on last edited by
                                      #18

                                      are that BIOSs work? :laugh:


                                      Russell

                                      1 Reply Last reply
                                      0
                                      • R Roger Broomfield

                                        obviously you have never disassembled BIOS. JMPing into the middle of functions is common practice in every BIOS I have ever disassembled.

                                        D Offline
                                        D Offline
                                        David Crow
                                        wrote on last edited by
                                        #19

                                        Last time I checked, Roger, we were discussing a C program.


                                        "A good athlete is the result of a good and worthy opponent." - David Crow

                                        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                                        1 Reply Last reply
                                        0
                                        • R Roger Broomfield

                                          having been brought up from coding raw hex on an 8080 SDK through Assembler and on into C and C++ I have no qualms about using goto. goto is after all just a JMP return -1 is also a JMP. break is also a JMP. why are you threatened by goto?

                                          R Offline
                                          R Offline
                                          Rajesh R Subramanian
                                          wrote on last edited by
                                          #20

                                          http://xkcd.com/292/[^] ;P


                                          Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->ßRÅhmmÃ<-·´¯`·.

                                          R 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