954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Array question

Hi
Iam using Borland Builder 5, and Ive got 10 TImages called Image1, Image2....Image10. I want to add these images to an array of type TImage can I do that in a for loop or do i have to add each Image by itself.

//this is the method Iam using
TImage ImageArray[10];
ImageArray[0] = Image1;
ImageArray[1] = Image2;
ImageArray[9] = Image10;

//this is the method I want to use
for( int i = 0; i <10; i++)
{
ImageArray[i] = XXX //what should replace the XXX if this is possible
}

shakoush2001
Newbie Poster
10 posts since Jul 2005
Reputation Points: 10
Solved Threads: 0
 

You'll have to use the former method -- C++ programs don't know anything about their variable's names at run time.

Rashakil Fol
Super Senior Demiposter
Team Colleague
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You