Skip to content

Instantly share code, notes, and snippets.

@gcnyin
Created July 23, 2020 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcnyin/37e08382f47c16e41386d72bd16e5ca1 to your computer and use it in GitHub Desktop.
Save gcnyin/37e08382f47c16e41386d72bd16e5ca1 to your computer and use it in GitHub Desktop.
c++ tolower command line tool
#include <algorithm>
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[]) {
if (argc < 2) {
exit(1);
}
string input = argv[1];
transform(input.begin(), input.end(), input.begin(), towlower);
cout << input << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment