0

I have a few code snippets from a tutorial Im reading my friend gave me to learn c++, and a lot of it is written in shorthand but I cannot fully understand the shorthand code.

return c < Cnt ? &foo[c]:NULL;;

this:

return (cc > 0 && cc <= mCnt)?&foo[cc-1]:NULL;

and this:

x = c < mCnt ? c + 1:0;

Thank you!

Edited by wschamps42

2
Contributors
3
Replies
18
Views
4 Years
Discussion Span
Last Post by wschamps42
0

@gerrard4143 I sort of understand it, I just cannot translate those snippets.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.