How can I return 2 Lists or Arrays from a function?
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Bruce Roeser47 reputationPosted Jul 5, 2010, 8:02 AM EDT
-b
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace LangTest {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void btnTwoArray_Click(object sender, EventArgs e) {
ArrayList ar1, ar2;
ar1 = new ArrayList();
ar2 = new ArrayList();
FillArrays(ar1, ar2);
for (int i=0; i
}
for (int i=0; i
}
}
private void FillArrays(ArrayList ar1, ArrayList ar2) {
ar1.Add("A");
ar1.Add("B");
ar1.Add("C");
ar2.Add("X");
ar2.Add("Y");
ar2.Add("Z");
}
}
}
Sam HobbsRank #107 · 20.5K reputationPosted Jul 5, 2010, 3:09 PM EDT