Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.
By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Can someone tell me how to use the min/max operators in C++ when incrementing/decrementing?
Can someone tell me how to use the min/max operators in C++ when incrementing/decrementing?

will increment xMyVar twice if it's the maximum but only once if it isn't
???
The way i recall it in XML is if i wanted to decrement something but have it stop at 0 i would use "0 max".
Vice versa if i wanted to stop incrementing at 10 i would use "10 min".
Now how does it differ in C++ aside from the RPN?
[FONT="Courier New"]#define max(a, b) (((a) > (b)) ? (a) : (b))[/FONT]
template <class T> const T tMax_mine( const T a, const T b )
{
return (a>b)? a: b;
}
int iMyVar = 2;
iMyVar = tMax_mine(++iMyVar, 1); returns 3
iMyVar = tMax_mine(1,--MyVar); returns 1
iMyVar = tMax_mine(1,MyVar); returns 2
float fMyVar = 1.5;
float fMax= 2.2;
fMyVar = tMax_mine(++fMyVar, fMax); returns 2.5

xMyVar = max(++xMyVar,xMax);
expands to
xMyVar = (((++xMyVar) > (xMax)) ? (++xMyVar) : (xMax))
AV Rule 29
Inline functions do not require text substitutions and are well-behaved when called with arguments (e.g. type-checking is performed).
Example: Compute the maximum of two integers.
#define max (a,b) ((a > b) ? a : b) // Wrong: macro
inline int32 maxf (int32 a, int32 b) // Correct: inline function
{
return (a > b) ? a : b;
}
y = max (++p,q); // Wrong: ++p evaluated twice
y=maxf (++p,q) // Correct: ++p evaluated once and type
// checking performed. (q is const)
If max is implemented as a macro then
Code:xMyVar = max(++xMyVar,xMax); expands to xMyVar = (((++xMyVar) > (xMax)) ? (++xMyVar) : (xMax))
++xMyvar is always evaluated and incremented once when it's tested against xMax and again if it's the maximum when it's assigned to XMyVar
And neither of those functions returns a value that's 'capped' at a max or a min value... which is what the '10 min' in XML would do... if your value exceeded 10... it would return 10 anyway.
Now, if one of the values passed to the min function was 10... it would either return 10 or your value that was less than 10... but it wouldn't prevent your variable from being incremented.
In XML
[B][FONT="Courier New"]Var -- 0 max (>Var)[/FONT][/B]
in C++ (with template function example)
[B][FONT="Courier New"]Var = tMax_mine(--Var,0); [/FONT][/B]
in XML
[B][FONT="Courier New"]Var ++ 10 min (>Var)[/FONT][/B]
in C++ (a similar template function returning (a<b) ? a: b )
[B][FONT="Courier New"]Var = tMin_mine(++Var,10); [/FONT][/B]
Exactly. But the template function lets you use the inc/dec risk free.
C generally doesn't support templates, only C++ does that.