Solved

Split function in vc++

Posted on 2003-11-10
6
343 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iframe detection of parent window scale 20 92
ASP/VB email question 4 62
printf performancy 11 84
Java array 10 57
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn different types of Android Layout and some basics of an Android App.
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…

756 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