944,123 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1438
  • C++ RSS
Jul 5th, 2005
0

Array question

Expand Post »
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
}
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shakoush2001 is offline Offline
10 posts
since Jul 2005
Jul 5th, 2005
0

Re: Array question

You'll have to use the former method -- C++ programs don't know anything about their variable's names at run time.
Team Colleague
Reputation Points: 1135
Solved Threads: 173
Super Senior Demiposter
Rashakil Fol is offline Offline
2,479 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Just a question regarding Variables in C++
Next Thread in C++ Forum Timeline: Checking for a blank textbox





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC