heyas,
if anyone could enlighten me as to why this is not acting as intended i'd be greatly apprecitive
it is *meant* to store the following
vector index 0: assume
vector index 1: nothing
vector index 2: expect
vector index 3: anything
what it is _actually_ storing is the following:
vector index 0: assume
vector index 1: nothing expect
vector index 2: expect anything
vector index 3: anything
also, i recieve different still results from using cin>>paramCommand;
any ideas why using cin would give different results to my static string in the example below?
i'm very keen to get on the top of both of these issues, thanks in advance.
Code:int index = 0; int loc = 0; /*keep iterating through string until the end using spaces as delimiter's */ paramCommand = "assume nothing expect anything"; while(loc <= paramCommand.length()) { loc = paramCommand.find(" ", index); command.push_back(paramCommand.substr(index, loc)); index = loc+1; }