Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@crisz possible. I'll have a look at it in a while as well as try @crystalclear 's suggestion
-
Gerschtli518ythe difference between pre and postincrement is:
a = 5;
a++; // output is 5, a is 6
++a; // output is 7, a is 7 -
b++ will be evaluated before incrementing. For example:
$b = 5
$c = 6
$ans = $b++ + $c ==> 5 + 6 at evaluation
// $ans is 11
//$b is now 6 -
retrix8088yHow were your answers correct and PHP wrong? PHP can't be wrong if you trying to manually determine what results PHP would produce. Your teacher is pulling your leg. Maybe give him/her a run down on what you learnt about post-incrementing.
-
@retrix actually, after my last comment about being correct.. I have yet to believe it was correct. I'll be coding the entire process to see why the answers were different.
The answers were completely different when done manually.
Knowing a language helps in programming class
undefined