Skip to content

Instantly share code, notes, and snippets.

Created August 20, 2017 21:57
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 anonymous/ec69054404e0aa8df95531c9d97a24ec to your computer and use it in GitHub Desktop.
Save anonymous/ec69054404e0aa8df95531c9d97a24ec to your computer and use it in GitHub Desktop.
Supposed to cut up sentences.
#include "D:\Users\Tijn\MyStuff\MyDocs\Visual Studio 2015\Projects\std_lib_facilities.h"
string Longestword(string sen)
{
string word;
int b = 0;
vector <string> v;
for (int a = sen.length(); a > 0; a--)
{
if (sen[b] == ' ')
{
v.push_back(word);
}
else
{
word = word + sen[b];
}
}
b++;
cout << v[1];
return 0;
}
int main()
{
string practice = "I am going to test this!";
Longestword(practice);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment