float[] x = new float[10000];
float[] y = new float[10000];
int c=0;
using (StreamReader sr = new StreamReader("e: \\CuPeak.dat"))
{
while (!sr.EndOfStream)
{
string s = sr.ReadLine();
string[] variables = s.Split(' ');
x[c] = float.Parse(variables[0]);//run time ERROR in this line " format exception was unhandled"
y[c] = float.Parse(variables[1]);
Console.WriteLine(x[0]);
}
}
sidd. 0 Light Poster
Alxandr 5 Junior Poster in Training
sidd. 0 Light Poster
kvprajapati 1,826 Posting Genius Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.