Solved

Split function in vc++

Posted on 2003-11-10
6
330 Views
Last Modified: 2006-11-17
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
Comment
Question by:Gopakumar
  • 2
6 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 125 total points
ID: 9714623
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
 

Expert Comment

by:TheMusikMan
ID: 9722746
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
 
LVL 48

Expert Comment

by:AlexFM
ID: 10319508
I think my answer is OK.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 131
oracle query help 18 113
Currency Conversion? 1 86
sp_configure 'external scripts enabled', 1; 7 51
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question