Object array declaration and initialisation

Résolu
cs_akaii Messages postés 109 Date d'inscription mardi 10 janvier 2006 Statut Membre Dernière intervention 14 février 2014 - 10 janv. 2006 à 14:21
cs_akaii Messages postés 109 Date d'inscription mardi 10 janvier 2006 Statut Membre Dernière intervention 14 février 2014 - 10 janv. 2006 à 15:26
hello
I need to pass an array of the object com.phone.www.info in a function so I'm trying to create an instance of this object like this:
com.phone.www.Info[] inf = new com.phone.www.Info() ;

I get this error message:
Error 1 Cannot implicitly convert type 'PBX_Admin_Console.com.innovaphone.www.Info' to 'PBX_Admin_Console.com.phone.www.Info[]' C:\Documents and Settings\xavier\My Documents\Visual Studio 2005\Projects\PBX_Admin_Console\PBX_Admin_Console\Form1.cs 29 42 PBX_Admin_Console

Does somebody have an idea about what I did wrong?

2 réponses

cs_coq Messages postés 6349 Date d'inscription samedi 1 juin 2002 Statut Membre Dernière intervention 2 août 2014 101
10 janv. 2006 à 14:36
Salut,

Par exemple :
com.phone.www.Info[] inf = new com.phone.www.Info[10] ;

/*
coq
MVP Visual C#
*/
3
cs_akaii Messages postés 109 Date d'inscription mardi 10 janvier 2006 Statut Membre Dernière intervention 14 février 2014
10 janv. 2006 à 15:26
Grand Merci à toi
je débute en C# (shame on me :-)
0
Rejoignez-nous