c++ - What does this line of code do? -



c++ - What does this line of code do? -

void expand_combinations(const char *remaining_string, string const & s, int rema in_depth) { if(remain_depth==0) { std::cout << s << std::endl; return; } for(int k=0; k < strlen(remaining_string); ++k) { string str(s); str.append(1, remaining_string[k]); expand_combinations(remaining_string+k+1, str, remain_depth - 1); // what? } return; }

on phone call function, it's passing string + integer. become?

remaining_string not string; it's pointer character. hence adding integer moves pointer.

for example, if char *blah = "hello", blah+1 point "ello".

c++ function

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -