Skip to content

Instantly share code, notes, and snippets.

@danhuynhdev
Created May 19, 2016 09:45
Show Gist options
  • Save danhuynhdev/9ab6437e2cde69320c71af868cb6d6df to your computer and use it in GitHub Desktop.
Save danhuynhdev/9ab6437e2cde69320c71af868cb6d6df to your computer and use it in GitHub Desktop.
#include <iostream>
#include <fstream>
#include <vector>
#include <ctype.h>
using namespace std;
int main() {
ifstream in_file("mauthu1.txt");
vector<string> chus;
if (in_file.is_open()) {
string temp;
while (!in_file.eof()) {
in_file >> temp;
chus.push_back(temp);
}
in_file.close();
}
ofstream out_file("mauthu2.txt");
if (out_file.is_open()) {
for (vector<string>::size_type i = 0; i < chus.size(); i++) {
chus[i][0] = toupper(chus[i][0]);
out_file << chus[i] << " ";
}
out_file << endl;
out_file.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment