15,743,958 members
Home / Discussions / C / C++ / MFC

# C / C++ / MFC

 How can merge 2 CUIntArray? Le@rner8-Apr-10 23:59 Le@rner 8-Apr-10 23:59
 Re: How can merge 2 CUIntArray? Eugen Podsypalnikov9-Apr-10 0:17 Eugen Podsypalnikov 9-Apr-10 0:17
 Re: How can merge 2 CUIntArray? Le@rner9-Apr-10 0:27 Le@rner 9-Apr-10 0:27
 Re: How can merge 2 CUIntArray? [modified] CPallini9-Apr-10 0:42 CPallini 9-Apr-10 0:42
 Re: How can merge 2 CUIntArray? [modified] Eugen Podsypalnikov9-Apr-10 0:57 Eugen Podsypalnikov 9-Apr-10 0:57
 Re: How can merge 2 CUIntArray? CPallini9-Apr-10 1:08 CPallini 9-Apr-10 1:08
 Re: How can merge 2 CUIntArray? Eugen Podsypalnikov9-Apr-10 1:13 Eugen Podsypalnikov 9-Apr-10 1:13
 Re: How can merge 2 CUIntArray? [updated] CPallini9-Apr-10 2:36 CPallini 9-Apr-10 2:36
 The following function works (at least I suppose it does...) with increasing-ordered arrays (without duplicate items): ```// merges arrays 'l' and 'r' into 'o'. // precondition: 'l','r' should be increasing-ordered, (without duplicate items). void MergeArrays(CUIntArray & l, CUIntArray & r, CUIntArray & o) { int il = 0, ir = 0; int lcount, rcount; lcount = l.GetCount(); rcount = r.GetCount(); o.RemoveAll(); for (;;) { if ( il == lcount) { if ( ir == rcount) return; o.Add(r[ir]); ir++; } else { if ( ir == rcount) { o.Add(l[il]); il++; } else { if (l[il] < r[ir]) { o.Add(l[il]); il++; } else if (l[il] > r[ir]) { o.Add(r[ir]); ir++; } else { o.Add(l[il]); il++; ir++; } } } } }``` If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile. This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke [My articles] modified on Friday, April 9, 2010 9:14 AM
 Re: How can merge 2 CUIntArray? Eugen Podsypalnikov9-Apr-10 3:05 Eugen Podsypalnikov 9-Apr-10 3:05
 Re: How can merge 2 CUIntArray? CPallini9-Apr-10 3:17 CPallini 9-Apr-10 3:17
 Re: How can merge 2 CUIntArray? Eugen Podsypalnikov9-Apr-10 3:34 Eugen Podsypalnikov 9-Apr-10 3:34
 Re: How can merge 2 CUIntArray? CPallini9-Apr-10 7:11 CPallini 9-Apr-10 7:11
 Re: How can merge 2 CUIntArray? CPallini9-Apr-10 0:23 CPallini 9-Apr-10 0:23
 Re: How can merge 2 CUIntArray? David Crow9-Apr-10 3:54 David Crow 9-Apr-10 3:54
 Re: How can merge 2 CUIntArray? CPallini9-Apr-10 7:16 CPallini 9-Apr-10 7:16
 Re: How can merge 2 CUIntArray? David Crow9-Apr-10 7:40 David Crow 9-Apr-10 7:40
 Re: How can merge 2 CUIntArray? CPallini9-Apr-10 8:35 CPallini 9-Apr-10 8:35
 Re: How can merge 2 CUIntArray? Eugen Podsypalnikov9-Apr-10 9:42 Eugen Podsypalnikov 9-Apr-10 9:42
 Marquee Progress Control JM22518-Apr-10 21:32 JM2251 8-Apr-10 21:32
 Re: Marquee Progress Control Eugen Podsypalnikov8-Apr-10 22:07 Eugen Podsypalnikov 8-Apr-10 22:07
 Re: Marquee Progress Control JM22518-Apr-10 22:16 JM2251 8-Apr-10 22:16
 Re: Marquee Progress Control Eugen Podsypalnikov8-Apr-10 22:55 Eugen Podsypalnikov 8-Apr-10 22:55
 Re: Marquee Progress Control [modified] JM22518-Apr-10 23:32 JM2251 8-Apr-10 23:32
 Re: Marquee Progress Control Eugen Podsypalnikov8-Apr-10 23:47 Eugen Podsypalnikov 8-Apr-10 23:47
 Re: Marquee Progress Control JM22518-Apr-10 23:51 JM2251 8-Apr-10 23:51
 Last Visit: 31-Dec-99 18:00     Last Update: 26-Sep-23 0:41 Refresh ᐊ Prev1...1942194319441945194619471948194919501951 Next ᐅ