Solved

Split strings that contains multiple null terminated strings..

Posted on 2000-03-27
2
344 Views
Last Modified: 2013-11-20
When using the GetPrivateProfileSection () I get according to MSDN: "The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character." What's the best way to split the string after the null characters? I want to store each string in a CString. Thanks...
0
Comment
Question by:joakimf
2 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 100 total points
ID: 2660426
Hi joakimf,

this functions fills a CStringArray with the strings passed:

void
SplitString( char* t, CStringArray& array )
{
 CString s;
 while ( *t != 0 )
 {
  s = t;
  array.Add( s );
  t += s.GetLength() + 1;
 }
}

hope that helps,

ZOPPO
0
 
LVL 1

Author Comment

by:joakimf
ID: 2664308
Thanks, excellent answer...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
move a line in eclipse 3 82
Hibernate methods 2 68
how to split multiple lines delimiter : 8 79
Making an alias 7 80
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now