Click here to Skip to main content
15,910,009 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
static void Main()
        {
               double [] tabseq= new double[3];
               inputvalue(tabseq);
        }
        public static void inputvalue(double[] tabseq)
        {
            int i;
            string invalue;
            Console.Write("enter tab seq");
            for (i = 0; i < 3; i++)
            {
                invalue = Console.ReadLine();
                tabseq[i] = double.Parse(invalue);
            }
        }

actualy my problem is,i cant pass single input..... i have to take input and store it somewhere, pass it to k means algorithm as heap... how could i do that
Posted
Updated 18-Dec-11 23:47pm
v3

Yes it is possible: both single dimension and multiple dimensions arrays contain items. So you are free to copy items from the former to the latter (and viceversa), e.g.
C#
double[] a = new double[4];
a[0] = 7.0;
a[1] = 1.0;
a[2] = .05;
a[3] = .05;
double [,] b = new double[2,2];
for (int i=0; i<2; i++)
  for(int j=0; j<2; j++)
    b[i,j]=a[i*2+j];
 
Share this answer
 
v4
Comments
shankar biradar 19-Dec-11 5:23am    
how can i do that tell me syntex
Also you can consider using generic lists , for example to have a list of float numbers :
C#
List<float> floats = new List<float>();


Or to have two dimensional list of floats try :
C#
List<List<float>> AllData = new List<List<float>>();


It will give you more programming power.

Hope it helps.
 
Share this answer
 
v2
Comments
Wendelius 19-Dec-11 12:23pm    
Edited: Encoded the greater than/less than characters.
Amir Mahfoozi 19-Dec-11 12:27pm    
Thank you Mika

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900