Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Défi : Déclaration de Tableau | Tableaux
Bases de C#
course content

Contenu du cours

Bases de C#

Bases de C#

1. Commencer
2. Traiter Avec les Types de Données
3. Structures de Contrôle
4. Boucles
5. Tableaux
6. Méthodes

book
Défi : Déclaration de Tableau

Créez un tableau vide appelé heights de type float et de longueur (taille) de 7.

cs

main

copy
12345678910111213
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line ___ } } }

La syntaxe pour déclarer un tableau vide est datatype[] arrayName = new datatype[size];.

cs

main

copy
12345678910111213
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line float[] heights = new float[7]; } } }

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 5. Chapitre 2
We're sorry to hear that something went wrong. What happened?
some-alt