Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is the syntax for declaring a float array named 'prices'?
Remember the data type followed by brackets.
How do you initialize an integer array of size 10 called 'scores'?
First, declare the array, then allocate memory.
What does it mean to declare an array?
Think about what the program needs to know before you use an array.
True or False: The size of an array can be changed after it has been initialized.
Consider what happens if you want to store more items than you have space for.
You need an array to hold a list of your 10 favorite fruits. Write the code to declare and initialize this array. Include the type and size.
Start by identifying the data type you wish to store.
Suppose you declared an integer array without initializing it. How would you check its length, and what error might occur? Create the code snippet and discuss potential issues.
Remember that an uninitialized array does not point to any memory.
4 more questions in this section. Enroll free to practise them all.
Enroll free