![]() |
Config string parse to select user-entered strings.
I am trying to parse a user-entered string and separate it at all the spaces, but I don't know how to change the parameters to accept user-entered strings, just what string is programmed in for the string already.
I did not create this code, but I am trying to modify it to work like I want it to, so don't ask me the how the whole thing works. Here is the code I am working on: Code:
//parser class--------------------------------------------I thinking it's something simple to do, but I just can't figure it out. Could someone help, please? And thanks. |
Re: Config string parse to select user-entered strings.
it might be easier to describe the inuts you are getting and what you want the outputs to be
|
Re: Config string parse to select user-entered strings.
Like the old code says, the input is: const char* userstring="RUN filename and this\n";
which is only "RUN filename and this". The output of that is: RUN filename and this I want to enter my own string, not what already is in the code, and have that parsed at the spaces. Ex: when prompted for a string when the program is running, I type: "Hello I typed this" Output: Hello I typed this I hope that clears that up. :) ------------------------------------------------- Updated: I have most of the parser figured out, but I am getting an error on this line: std::istringstream buffer(text); error: variable `std::istringstream buffer' has initializer but incomplete type I don't know what' wrong with the type, so could someone help me with that? Here's the new code: Code:
#include <iostream> |
Re: Config string parse to select user-entered strings.
Put your code in code tags. If you don't know what that means, read the "Before you make a query" thread. Also, some Visine would be good to get the red out.
|
Re: Config string parse to select user-entered strings.
|
| All times are GMT +5.5. The time now is 13:25. |