string(int, *begin++) ?

Would anyone know what this is? I've never seen a string with two arguments like this before. *begin is an iterator.

 
  std::string StringVariableName(1, *begin++);
Last edited on
http://www.cplusplus.com/reference/string/string/string/

Basically the 1 is the amount of characters you want to fill and teh *begin++ is basically videoconferencing begin (which I am assuming is a pointer to a string or iterator to a string) which would result in a specific character then you increment the pointer/iterator by one.

Basically it's like this

1
2
std::string str( 1 , '*' ); // *
std::string str2( 2 , '^' ); // ^^ 


Thanks for the explanation and the link. That explains it then.
Topic archived. No new replies allowed.