• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 3 of 3
    1. #1
      Newbie
      I just started learning and
      hoping to learn a lot
       
      Feeling Normal
       
      zzlazyzz's Avatar
      Join Date
      Jan 2014
      Posts
      7
      Thanks (-->)
      0
      Thanks (<--)
      0

      i dont understand why i got the error

      John Kittz
      #include <iostream>

      using namespace std;


      int main()
      {
      int x = 10;
      int y = 5;
      cout << "x = 10";
      cin >> x = 10;
      cout << "y = 5";
      cin >> y = 5;
      cout << x << "+" << y << "=" << x + y << endl;

      return 0;
      }

      Error:

      C:\HACKS\Ch.3Practice2\main.cpp|11|error: no match for 'operator=' in 'std::cin.std::basic_istream<_CharT, _Traits>:perator>><char, std::char_traits<char> >((* & x)) = 10'|

      C:\HACKS\Ch.3Practice2\main.cpp|13|error: no match for 'operator=' in 'std::cin.std::basic_istream<_CharT, _Traits>:perator>><char, std::char_traits<char> >((* & y)) = 5'|

    2. #2
      Administrator
      Hacked By Jesus
       
      Reversing
       
      [GH]Rake's Avatar
      Join Date
      Jan 2014
      Location
      USA
      Posts
      3,093
      Thanks (-->)
      694
      Thanks (<--)
      912
      This was your code:
      #include <iostream>

      using namespace std;


      int main()
      {
      int x = 10;
      int y = 5;
      cout << "x = 10";
      cin >> x = 10;
      cout << "y = 5";
      cin >> y = 5;
      cout << x << "+" << y << "=" << x + y << endl;

      return 0;
      }


      I think you just need to read and practice more, I'm not sure you're understanding the basics just yet but you will!

      Line 1-7 no problems.
      Line 8 & 9 you declare 2 integers and assign them respective values.
      Line 10&12 you ouput your message in quotations to the screen. If the value of x & y change the cout only prints your message, not the correct values.
      But for practicing the basics that is fine.
      Line 11 & 13 are the lines with your errors. I'm not sure you understand how to use them.
      Line 14-17 are fine.

      In fact line 11 & 13 aren't neccesary for this program to run because you don't need any input because you've already assigned values to the variables x & y.

      Here is the code line with 11 & 13 removed. I added "<< endl;" to your cout lines so it will look better on the screen. So no input is necessary -- your next step would be to have this program take input from the user for the values of x & y.

      #include "stdafx.h"
      #include <iostream>
      using namespace std;

      int main()
      {
      int x = 10;
      int y = 5;
      cout << "x = 10" <<endl;
      cout << "y = 5" << endl;
      cout << x << "+" << y << "=" << x + y << endl;

      return 0;
      }


      Good luck!
      Last edited by [GH]Rake; 02-13-2014 at 06:03 PM.

    3. #3
      Jr.Hacker
      Haze-Productions
       
      Coding
       
      rN''s Avatar
      Join Date
      Jan 2014
      Posts
      340
      Thanks (-->)
      20
      Thanks (<--)
      126
      Cheats'n'Trainers
      std::cin is an Input command..

      #include <iostream>

      using namespace std;

      int main( void )
      {
      int Number1 = 0;
      int Number2 = 0;

      cout << "Enter your first Number:";
      cin >> Number1;
      cout << "Enter your seconed Number:";
      cin >> Number2;
      cout << "The total sum of " << Number1 << " and " << Number2 << " is " << Number1 + Number2 << endl;
      cout << "The difference of " << Number1 << " and " << Number2 << " is " << Number1 - Number2 << endl;

      system( "pause" );
      return 0;
      }
      Last edited by rN'; 02-13-2014 at 07:03 PM.

    4. Thanks till0sch thanked for this post

    Similar Game Hacker Threads

    1. Replies: 2
      Last Post: 02-05-2016, 04:42 AM
    2. Trying to understand AoB scanning, can't seem to get it right though.. Help!
      By Legolas The Destroyer in forum CS:GO Hacks Help
      Replies: 5
      Last Post: 07-12-2015, 06:25 AM
    3. [Help] I dont understand these errors?
      By rulethecool in forum Hacking Help
      Replies: 4
      Last Post: 10-04-2014, 12:00 PM
    4. [Help] Fleep's Tutorials dont work online ?
      By PROGRAMMER-X in forum GH Tutorials Help
      Replies: 2
      Last Post: 08-14-2014, 11:56 AM
    5. Replies: 17
      Last Post: 07-19-2013, 10:55 AM

    Tags for this Thread