Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Adding String

godofhellfire
Beginner
340 Views
I am trying to add a string to an already existing line of a ListBox. When I compile, I am given the error "Structure required on left side of "." or ".*". The line of code that I was trying to use for this is:

(ListBox1->Items.Strings[0])+=(ListBox1->Items.Strings[0]+"ANSISTRING");

Could someone help me with this code?

Thanx
0 Kudos
1 Reply
rmauldin
Beginner
340 Views
(ListBox1->Items.Strings[0])+=(ListBox1->Items.Strings[0]+"ANSISTRING");
try
ListBox1->Items.Strings[0] += "ANSISTRING";
dont make your code more difficult than it has to be... if the Items.Strings are in fact type String or string.
or try
ListBox1->Items.Strings[0].append() method may prove more bennificial in readability.
0 Kudos
Reply