Course Content
C# Basics
C# Basics
2. Dealing with Data Types
Challenge: Array Declaration
Create an empty array called heights
of type float
and length (size) of 7
.
main
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line ___ } } }
The syntax of declaring an empty array is datatype[] arrayName = new datatype[size];
.
main
using System; namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Declare an array below this line float[] heights = new float[7]; } } }
Everything was clear?
Thanks for your feedback!
Section 5. Chapter 2