Results 1 to 3 of 3

Thread: C++ compile issue

  1. #1
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default C++ compile issue

    I get a expected `;' before "MOD" compile error. Why is that and how do I make it work?
    -JF

  2. #2
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Figured it out. If you put in MOD, it is an invalid command. The character for MOD is the % symbol. If you want it to do the MOD of a number then you must do number % number. Thanks for at least looking to see if you could help.
    -JF

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ah. Modulus. Haven't used it in C++, but that's fairly common in PHP.
    5%4 = 1. 6%3 = 0. 9%5 = 4. Remainder of division. Helping in looping setups.
    Though you may already know this. If not, should give you some idea.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •