Re: How can I convert 2D array to 1D array

From: Emad Barsoum (e_barsoum_at_hotmail.com)
Date: 03/20/04


Date: Sat, 20 Mar 2004 08:28:48 -0800

Hi,

    To convert 2D to 1D:

    for(int i=0;i<2;i++)
        for(int j=0;j<2;j++)
        {
            one[j + i*2] = array[i,j];
         }

Regards,
Emad

"Tonyukuk" <bilgetonyukuk@hotmail-dot-com.no-spam.invalid> wrote in message
news:405c11f6_2@Usenet.com...
> For example I have an 2D array.
> int [,] array=new int[2,2];
> and I can convert it into one[4]
> how can I do that ?
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com



Relevant Pages

  • Re: Slowest learners?
    ... Best regards, ... Sanne.Kj's Profile: http://www.unicyclist.com/profile/17295 ... Posted Via Usenet.com Premium Usenet Newsgroup Services ...
    (rec.sport.unicycling)
  • electronic circuit simulation software
    ... Posted Via Usenet.com Premium Usenet Newsgroup Services ...
    (sci.electronics.design)
  • mouse position in Click-Event
    ... is a EventArgs object!)? ... Thanks and Regards, ... Posted Via Usenet.com Premium Usenet Newsgroup Services ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: First successful free mount
    ... Best regards, ... Sanne.Kj's Profile: http://www.unicyclist.com/profile/17295 ... Posted Via Usenet.com Premium Usenet Newsgroup Services ...
    (rec.sport.unicycling)
  • no resize
    ... Regards ... Magnus ... Posted Via Usenet.com Premium Usenet Newsgroup Services ...
    (microsoft.public.dotnet.languages.vb)