Combining arrays?? Need Help

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2008
Posts: 12
Reputation: swbuko is an unknown quantity at this point 
Solved Threads: 0
swbuko swbuko is offline Offline
Newbie Poster

Combining arrays?? Need Help

 
0
  #1
Sep 18th, 2008
I've got 5 arrays each with one number in them, but in order to sort them using the insertion method, I need to combine them into a single array. How do I do this? This is the last part of my program and can't figure it out!
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,828
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 501
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Combining arrays?? Need Help

 
0
  #2
Sep 18th, 2008
Originally Posted by swbuko View Post
I've got 5 arrays each with one number in them, but in order to sort them using the insertion method, I need to combine them into a single array. How do I do this? This is the last part of my program and can't figure it out!
More details please. You want to concatenate five arrays into one? So you have an array a = {1} and an array b = {6}, you want to make an array c = {1, 6}, except there are five arrays, not two? All this prior to the sort?
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 12
Reputation: swbuko is an unknown quantity at this point 
Solved Threads: 0
swbuko swbuko is offline Offline
Newbie Poster

Re: Combining arrays?? Need Help

 
0
  #3
Sep 18th, 2008
I've got a big array of numbers called LBS[x]. It is broken up into columns like so -->

1112 10 11 12
2222 13 14 15
3332 16 17 18
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 12
Reputation: swbuko is an unknown quantity at this point 
Solved Threads: 0
swbuko swbuko is offline Offline
Newbie Poster

Re: Combining arrays?? Need Help

 
0
  #4
Sep 18th, 2008
starting from the top left, my array goes as so.


group# BM Shear Torsion
LBS[0] LBS[1] LBS[2] LBS3]
LBS[4] LBS[5] LBS[6] LBS[7]
LBS[8] LBS[9] LBS[10] LBS[11]

Ultimately I need to use insertion sort, to sort the group by BM, Shear, and Torsion. Example would be we are sorting by BM, so it would look like this. LBS[5] to LBS[1] is the order.

group# BM Shear Torsion
LBS[4] LBS[5] LBS[6] LBS[7]
LBS[8] LBS[9] LBS[10] LBS[11]
LBS[0] LBS[1] LBS[2] LBS3]
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 3,828
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 501
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Combining arrays?? Need Help

 
0
  #5
Sep 18th, 2008
Originally Posted by swbuko View Post
starting from the top left, my array goes as so.


group# BM Shear Torsion
LBS[0] LBS[1] LBS[2] LBS3]
LBS[4] LBS[5] LBS[6] LBS[7]
LBS[8] LBS[9] LBS[10] LBS[11]

Ultimately I need to use insertion sort, to sort the group by BM, Shear, and Torsion. Example would be we are sorting by BM, so it would look like this. LBS[5] to LBS[1] is the order.

group# BM Shear Torsion
LBS[4] LBS[5] LBS[6] LBS[7]
LBS[8] LBS[9] LBS[10] LBS[11]
LBS[0] LBS[1] LBS[2] LBS3]

You said you had five arrays, each with one number in it. I see one array with twelve numbers in it. Where are the five arrays?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC