Horje
sort strings by length and by alphabet Code Example
sort strings by length and by alphabet
bool comp(string a, string b) {
	if (a.size() != b.size()) return a.size() < b.size(); // primarily by length
	return a < b;  //secondarily by alphabetical
}




Cpp

Related
ex: cpp Code Example ex: cpp Code Example
c++ while Code Example c++ while Code Example
how to concatinate two strings in c++ Code Example how to concatinate two strings in c++ Code Example
how to convert ascii to char in cpp Code Example how to convert ascii to char in cpp Code Example
Split a number and store it in vector Code Example Split a number and store it in vector Code Example

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