Like Tree2Likes
  • 1 Post By laserlight
  • 1 Post By Salem

What is "-=" ???

This is a discussion on What is "-=" ??? within the C++ Programming forums, part of the General Programming Boards category; There was a RPG source code written in c++ that had this: Code: y -= 1; If you guys want ...

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    67

    What is "-=" ???

    There was a RPG source code written in c++ that had this:
    Code:
    y -= 1;
    If you guys want I'll add in the whole(still uncomplete) source code, but I figured it wouldn't matter.

    But what is a subtraction sign doing next to an equal sign??

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,403
    It means:
    Code:
    y = y - 1;
    cplusplusnoob likes this.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Lookup "assignment operator" in your C++ book.
    cplusplusnoob likes this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    Nov 2011
    Posts
    67
    Thanks guys! Much appreciated!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 03-31-2009, 04:23 PM
  2. Replies: 46
    Last Post: 08-24-2007, 04:52 PM
  3. "itoa"-"_itoa" , "inp"-"_inp", Why some functions have "
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 12-08-2002, 07:25 AM
  4. "CWnd"-"HWnd","CBitmap"-"HBitmap"...., What is mean by "
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 06:59 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21