-
February 25th, 2010, 09:06 PM
#1
Possible? Simple loop to attach int to a string
I have a Windows Form app that has over 100 textboxes. I need to convert them all into integers so I can add them to an array. Is something to this extent possible:
int a [99]
for(int i = 0, i < 100, i++)
{
Int32::TryParse(textBox(i)->Text, a[i]);
}
I know it cant be done like this but I need something relatively simple like this. Thanks in advance.
-
February 25th, 2010, 09:15 PM
#2
Re: Possible? Simple loop to attach int to a string
You could use a stringstream, or strtol().
-
February 26th, 2010, 06:40 PM
#3
Re: Possible? Simple loop to attach int to a string
Sorry to be such a newbie but could give me an example of stringstream. I have read various sources on the net but they kind of go over my head alittle. I really feel like I'm not getting my money's worth in my Visual C++ class because we aren't going over a lot of things that to me seem vary important.
-
February 27th, 2010, 03:06 AM
#4
Re: Possible? Simple loop to attach int to a string
Tags for this Thread
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
|