How to tokenize a string without boost?

I think that sscanf is what you are looking for.

I think that sscanf is what you are looking for : cplusplus.com/reference/clibrary/cstdio/... You can then use snprintf to reformat the data.

2 sscanf(...) is part of "simple" C. In general choosing a STL/C++ solution is usually the safer way to go. Which can mean - for example - that you get errors at compile time rather than runtime.

And often the STL/C++ solution is also easier to read. I strongly suggest you have a look at the ">>"-operator, the -class, and the -class. – AudioDroid Aug 1 at 9:45 Downvoted, mostly because it got accepted.It's a possible solution, but not "the C++ way".

C++11 regex or std::istringstream are definitely better solutions. – Lstor Aug 1 at 10:23.

You may take a look at std::istringstream and its >> operator (not as explicit as sscanf though).

If you have C++11, the simplest solution would be to use regular expresssions. It's also possible to use std::istringstream, especially if you have some additional manipulators for e.g. Matching a single character.(If you don't, you probably should. The problem occurs often enough.

) For something this simple, however, both of these solutions might be considered overkill: std::find for 'T', then for ' ' will give you an iterator for each of the two characters, and the double iterator constructors of std::string, will give you the strings, e.g. : std::string::const_iterator posT = std::find( s.begin(), s.end(), 'T' ); std::string::const_iterator posSpace = std::find( posT, s.end(), ' ' ); std::string date( s.begin(), posT ); std::string time( posT! = posSpace? PosT + 1 : posT , posSpace ); (You'll probably want better error handling that I've provided.

).

You can use strsep() or strtok_r() to split this string in what you want with your separators (in your case 'T' and ':').

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions