Solved

Split function in vc++

Posted on 2003-11-10
6
351 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

Industry Leaders: 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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

623 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