for (int i = 0 ; i < customerList.Count; i++) {
string everything = {customerList.Name, customerList_.Age.ToString(), customerList*.Male.ToString(),
customerList.Income.ToString(), customerList.Married.ToString(),customerList.Luxurious.ToString(),
customerList.Liberal.ToString(),customerList.Type1.ToString(),customerList.Type2.ToString(),
customerList.Type3.ToString(),customerList.Impulse.ToString(),customerList.Trender.ToString()};*_
* using (System.IO.StreamWriter file = new System.IO.StreamWriter(testingdir)) {*
* foreach (string @string in everything) {*
* file.Write(@string);*
* file.Write(" ");*
* }*
* }*
* }*
The above foreach loop is in a for loop. I have the program output how many customers there are in the customer list, and it is more than 1. I had the array everything output to console and it does output the correct number of customers. However, when I try to write this to a file, it only shows 1 customer information. I tried changing the foreach loop into a for loop and it’s the same result. What do I have to do to make it loop?