Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Technical Support » Other » Need help with my C++ code
Re: Need help with my C++ code [message #445235 is a reply to message #445206] Thu, 24 March 2011 02:12 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
Yeah, DP's right.

When you call the function you're not even asking for a return value:

          if (string_pool == "quarter")
          {              
              coin = quarter;
              insert_coin(coin, money_pool);
          }


If you was doing this:

          if (string_pool == "quarter")
          {              
              coin = quarter;
              double return = insert_coin(coin, money_pool);
              printf("%d\n", return); //or cout, whatever
          }


Then I might understand, but even then, you would still be able to do:

          if (string_pool == "quarter")
          {              
              coin = quarter;
              insert_coin(coin, money_pool);
              printf("%d\n", money_pool); //or cout, whatever

          }


I believe that is the point DP was trying to make to you.



 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: need help with php
Next Topic: Is it possible to replace the CPU Fans on laptops?
Goto Forum:
  


Current Time: Tue Jun 18 17:46:56 MST 2024

Total time taken to generate the page: 0.00740 seconds