Horje
string split by space c++ Code Example
cpp split string by space
std::vector<std::string> string_split(const std::string& str) {
	std::vector<std::string> result;
	std::istringstream iss(str);
	for (std::string s; iss >> s; )
		result.push_back(s);
	return result;
}
string split by space c++
// Extract the first token
char * token = strtok(string, " ");
// loop through the string to extract all other tokens
while( token != NULL ) {
  printf( " %s\n", token ); //printing each token
  token = strtok(NULL, " ");
}
return 0;




Cpp

Related
cmake define standard c++ Code Example cmake define standard c++ Code Example
New Year's Eve Code Example New Year's Eve Code Example
binary search c++ Code Example binary search c++ Code Example
c++ accessing parent class functinons Code Example c++ accessing parent class functinons Code Example
STL c++ Code Example STL c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8