• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Split function in vc++

I have text file containing some lines(separated by \r\n) .Each line contains some coma separated values. Is there any built in fns available to spilt a String based on some delimiter and populate it into an array (like split function in vb) in VC++

thanks
gp
0
Gopakumar
Asked:
Gopakumar
  • 2
1 Solution
 
AlexFMCommented:
1) strtok function - quick and dirty solution. C++ snobs don't like it, but it works.

2) http://www.boost.org/libs/tokenizer/index.htm - string tokenizer class which is part of Boost library:

http://www.boost.org/
0
 
TheMusikManCommented:
strtok is what I usually use, but I believe that strtok is NOT thread safe, so if you're using multi-threading technology, you may have to dig further.

TheMusikMan
0
 
AlexFMCommented:
I think my answer is OK.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now