Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multi-dimensional arrays
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00678465
Message ID:
00678473
Vues:
22
This message has been marked as a message which has helped to the initial question of the thread.
Yes, because everything is an object in c#.
In fact, the following code create an array of 2 arrays
object[,] multitype = {{4, 5, 6, 1},{ "Claudio","Michel","Carlos","John"}};
for (int i=0;i<2;i++)
{
	for (int ii=0;ii<4;ii++)
	{
		System.Console.WriteLine(multitype[i,ii]);
		System.Console.WriteLine(multitype[i,ii].GetType() );
	}
}
>Hi, everybody.
>
>Is it possible to create an multi-dimensional array in C# which contains columns of different type? If so, how?
>
>For example, in VFP we can do this:
>
>
>local Persons(2,2)
>Persons(1,1) = "John Jones"
>Persons(1,2) = 24
>
>Persons(2,1) = "Paul Wink"
>Persons(2,2) = 30
>
>
>Is it possible in C#?
>
>TIA
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform