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!

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

Nevermind I figured it out. Thanks for the link!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.