Program to generate a collection of strings for a Collection Initialization (Vector, List, etc).
Program to generate a collection of strings for a Collection Initialization (Vector, List, etc).
You can input a list of sentences with line breaks.
3D animation
The game has started
Jump over the fence
Runing as fast as the speed of light
Looking into the eyes of the lion
You can input a list of space separated words.
Cat Dog Fish Hamster Crocodile
Copy and paste the result to you’re app source code and you’re ready to keep on you’re happy coding streak!
---- DONE READING INPUT FILE ----
"3D animation",
"The game has started",
"Jump over the fence",
"Runing as fast as the speed of light",
"Looking into the eyes of the lion",
---- DONE PRINTING OUTPUT ----
---- DONE READING INPUT FILE ----
"Cat",
"Dog",
"Fish",
"Hamster",
"Crocodile",
---- DONE PRINTING OUTPUT ----
If you wish to switch between the type of input files you are going to read you just need to comment and uncomment the following lines of code.
// Line break sentence list.
while(getline(cin, inputString)){
inputList.push_back(inputString);
}
// Space separated word list.
/*
while(cin >> inputString){
inputList.push_back(inputString);
}
*/
If you wish to sort the list before printing it out to initialize you’re own collection, you can uncomment the following line in the program and it will sort the list before giving you the output.
// sort(inputList.begin(), inputList.end());
If you wish to contribute to the project all ideas and improvements are welcomed, send in a PR and add yourself in the list of Contributors!