-
September 26th, 2008, 03:24 AM
#1
String Array Problem
Hi
I have a problem to store variable in array.I have a two String one is Array CString as[100] and second one is simple CString sw.
Now i want to store sw values in as[].How can i store?Plz help me
Thanks in Advance
-
September 26th, 2008, 03:40 AM
#2
Re: String Array Problem
Get rid of c-type arrays.
Use MFC CStringArray class (or std::vector) instead.
Victor Nijegorodov
-
September 26th, 2008, 05:35 AM
#3
Re: String Array Problem
Originally Posted by VictorN
Get rid of c-type arrays.
Use MFC CStringArray class (or std::vector) instead.
I am doing like that
Code:
CString a1[100];
CString b;
a1[0] = strFileName1;
a1[1] = strFileName1;
But i am wrong some where becouse every time both a1[0] and a1[1] value changed. But i want to store different value in a1[0] 1nd a1[1]. If a1[0] have value then value store in a1[1].
String b value every time change.Like this first time b="ssd" and second time b="mkkj". And i want to store value like that first time a1[0]="ssd" and second time a1[0]="ssd" and a1[1]="mkkj". Plz help me
Thanks in Advance
-
September 26th, 2008, 05:45 AM
#4
Re: String Array Problem
Originally Posted by anubhava
...Plz help me
It wouldn't be a problem to help you if you'd help us to understand what you need, what and how you already tried it and what your problem is.
Unfortunately, the four lines of sensenless code and very poor explanation don't give us any idea...
Victor Nijegorodov
-
September 26th, 2008, 07:03 AM
#5
Re: String Array Problem
Originally Posted by anubhava
I am doing like that
Code:
CString a1[100];
CString b;
a1[0] = strFileName1;
a1[1] = strFileName1;
So what is "strFileName1"?
Second, show us a small but complete example that duplicates the problem. (Just a main() program and a simple program that duplicates the problem that you're having).
Regards,
Paul McKenzie
-
September 26th, 2008, 07:12 AM
#6
Re: String Array Problem
try using CStringArray instead of a C style array.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|