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. Im just new in c++ [modified]

Im just new in c++ [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
9 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.
  • A Offline
    A Offline
    Amr M K
    wrote on last edited by
    #1

    Dear All, I am still new in c++ i would like to implement this class how?? void main() } ;(A a1(1,1 ;(A a3(2,2 ;(A a3(0,0 a3=a1+a2; ++ a1 () a3.out a3=a1-a3 {() a3.out

    Yes. CreatiVity withOuT limiTs

    modified on Friday, December 11, 2009 3:57 PM

    _ C D 3 Replies Last reply
    0
    • A Amr M K

      Dear All, I am still new in c++ i would like to implement this class how?? void main() } ;(A a1(1,1 ;(A a3(2,2 ;(A a3(0,0 a3=a1+a2; ++ a1 () a3.out a3=a1-a3 {() a3.out

      Yes. CreatiVity withOuT limiTs

      modified on Friday, December 11, 2009 3:57 PM

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      This doesn't look like C++ to me.

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      L A 2 Replies Last reply
      0
      • _ _Superman_

        This doesn't look like C++ to me.

        «_Superman_» I love work. It gives me something to do between weekends.
        Microsoft MVP (Visual C++)

        A Offline
        A Offline
        Amr M K
        wrote on last edited by
        #3

        its like procedure must be implemnt in c++

        Yes. CreatiVity withOuT limiTs

        1 Reply Last reply
        0
        • _ _Superman_

          This doesn't look like C++ to me.

          «_Superman_» I love work. It gives me something to do between weekends.
          Microsoft MVP (Visual C++)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I think he want's to port it over to C++, or maybe it's some sort of class diagram outlining functionality...

          Check out the CodeProject forum Guidelines[^] The original soapbox 1.0 is back![^]

          1 Reply Last reply
          0
          • A Amr M K

            Dear All, I am still new in c++ i would like to implement this class how?? void main() } ;(A a1(1,1 ;(A a3(2,2 ;(A a3(0,0 a3=a1+a2; ++ a1 () a3.out a3=a1-a3 {() a3.out

            Yes. CreatiVity withOuT limiTs

            modified on Friday, December 11, 2009 3:57 PM

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

            Do you want to convert ASCII-art into C++ code? :-D

            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]

            L 1 Reply Last reply
            0
            • C CPallini

              Do you want to convert ASCII-art into C++ code? :-D

              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]

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              yes, and without limits please. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


              A 1 Reply Last reply
              0
              • L Luc Pattyn

                yes, and without limits please. :)

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


                A Offline
                A Offline
                Amr M K
                wrote on last edited by
                #7

                #include <iostream> using namespace std; class A { private: int x; int y; public: A() { x = 0; y = 0; } A(int First, int Second) { x=First; y=Second; } // Opertator // A operator= ( A &oA); A operator- ( A oA); A operator+ ( A oA); A& operator++(int unu); // prefix int GetMyX() { return x; } int GetMyY() { return y; } void SetMyX(int Xvalue) { x=Xvalue; } void SetMyY(int Yvalue) { y=Yvalue; } void Out() { cout<<"Value Of x:" << GetMyX()<<" "<<"Value Of y:"<<GetMyY()<<endl ; } }; A A:: operator- (A oA) { oA.SetMyX (oA.GetMyX ()-x); oA.SetMyY (oA .GetMyY ()-y); return oA; } A A::operator+ (A oA) { oA.SetMyX (oA.GetMyX ()+x); oA.SetMyY (oA .GetMyY ()+y); return oA; } A& A::operator++(int temp) { SetMyX (GetMyX ()+1); SetMyY (GetMyY ()+1); return *this; } int main() { using namespace std; A a1(2,4); A a2(3,6); A a3(0,0); a1++; a1.Out (); a3=a1+a2; a3.Out (); a3=a1-a3; a3.Out (); int x; cin>>x; return 0; }

                Yes. CreatiVity withOuT limiTs

                T 1 Reply Last reply
                0
                • A Amr M K

                  Dear All, I am still new in c++ i would like to implement this class how?? void main() } ;(A a1(1,1 ;(A a3(2,2 ;(A a3(0,0 a3=a1+a2; ++ a1 () a3.out a3=a1-a3 {() a3.out

                  Yes. CreatiVity withOuT limiTs

                  modified on Friday, December 11, 2009 3:57 PM

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

                  Could you at least be bothered to fix this so it is legible? Did you use the Preview button before posting?

                  "One man's wage rise is another man's price increase." - Harold Wilson

                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                  1 Reply Last reply
                  0
                  • A Amr M K

                    #include <iostream> using namespace std; class A { private: int x; int y; public: A() { x = 0; y = 0; } A(int First, int Second) { x=First; y=Second; } // Opertator // A operator= ( A &oA); A operator- ( A oA); A operator+ ( A oA); A& operator++(int unu); // prefix int GetMyX() { return x; } int GetMyY() { return y; } void SetMyX(int Xvalue) { x=Xvalue; } void SetMyY(int Yvalue) { y=Yvalue; } void Out() { cout<<"Value Of x:" << GetMyX()<<" "<<"Value Of y:"<<GetMyY()<<endl ; } }; A A:: operator- (A oA) { oA.SetMyX (oA.GetMyX ()-x); oA.SetMyY (oA .GetMyY ()-y); return oA; } A A::operator+ (A oA) { oA.SetMyX (oA.GetMyX ()+x); oA.SetMyY (oA .GetMyY ()+y); return oA; } A& A::operator++(int temp) { SetMyX (GetMyX ()+1); SetMyY (GetMyY ()+1); return *this; } int main() { using namespace std; A a1(2,4); A a2(3,6); A a3(0,0); a1++; a1.Out (); a3=a1+a2; a3.Out (); a3=a1-a3; a3.Out (); int x; cin>>x; return 0; }

                    Yes. CreatiVity withOuT limiTs

                    T Offline
                    T Offline
                    Tim Craig
                    wrote on last edited by
                    #9

                    Is there a question in there? It's just a bunch of code although it does look like C++ this time.

                    You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

                    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