Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: string spli...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 9559 of 9831
Post > Topic >>

Re: string splitting

by Alexey Stepanyan <alexeystepanyan@[EMAIL PROTECTED] > Apr 29, 2008 at 05:38 PM

Hope, this helps.

#include <sstream>
#include <iterator>
#include <algorithm>
#include <string>
#include <iostream>

int main()
{
	std::istringstream stream( "16:23:18.659343 131.188.37.230.22
131.188.37.59.1398 tcp 168");
	std::copy( std::istream_iterator<std::string>( stream ),
		  std::istream_iterator<std::string>(),
                     std::ostream_iterator<std::string>( std::cout,
"\n") );
	return 0;
}

-------------------------

16:23:18.659343
131.188.37.230.22
131.188.37.59.1398
tcp
168

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 5 Posts in Topic:
string splitting
xyz <lavanyareddy.p@[E  2008-04-29 10:43:22 
Re: string splitting
"Hakusa@[EMAIL PROTE  2008-04-29 17:38:05 
Re: string splitting
Alexey Stepanyan <alex  2008-04-29 17:38:54 
Re: string splitting
Alexey Stepanyan <alex  2008-04-29 17:40:29 
Re: string splitting
"Devdatt Lad" &  2008-04-30 10:41:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 21:51:51 CDT 2008.