Wednesday, 15 May 2013

syntax - Asterisk usage in variable naming -



syntax - Asterisk usage in variable naming -

i came across solution reserving c-style string. here code:

void reserve(char *str) { char * end = str; char tmp; if (str) { while(*end) { ++end; } --end; while (str < end) { tmp = *str; *str++ = *end; *end-- = tmp; } } }

question: *str mean char type in function, , how * end ?

that isn't java. can't begin variables in java '*'.

syntax asterisk

No comments:

Post a Comment