Skip to content
KnowledgeCity

Programming with C: Two-Dimensional Arrays

Learn how to store tabular data in C using two-dimensional arrays.
Preview the first lesson free — get full access to all 4 lessons.
Course: On-Demand
Intermediate Provider Mike McMillan  4 Lessons ·  11m  in Arabic, German, English, Spanish, French, Portuguese, Chinese 

Course Description

In these lessons, we’ll discuss how to create and use two-dimensional arrays in C. Two-dimensional arrays store data in tabular form, meaning in rows and columns like an Excel spreadsheet.

We’ll begin by discussing how to declare two-dimensional arrays in C. Then we’ll cover how to initialize two-dimensional arrays using the same technique you use to initialize one-dimensional arrays, but this time creating a list of lists. We’ll then discusses how to access and store data in two-dimensional arrays, concluding with some examples of how to perform row-wise and column-wise computations.

What You'll Learn

  • Declare two-dimensional arrays in C and identify the types of data they store
  • Initialize a two-dimensional array with rows and columns of data as a list of lists
  • Access and store data in a two-dimensional array using row and column references
  • Perform row-wise and column-wise computations on two-dimensional arrays
  • Work with jagged arrays in C

Key Takeaways

  • Two-dimensional arrays in C store data in tabular form, organized in rows and columns like an Excel spreadsheet.
  • Two-dimensional arrays are initialized using the same technique as one-dimensional arrays, but by creating a list of lists.
  • Data in a two-dimensional array is accessed and stored using row and column references.
  • Two-dimensional arrays can be accessed to perform both row-wise and column-wise computations.

Frequently Asked Questions

What does this course cover?

The course covers how to create and use two-dimensional arrays in C, including declaring them, initializing them with rows and columns of data, accessing and storing data using row and column references, and performing row-wise and column-wise computations.

What are two-dimensional arrays in C?

Two-dimensional arrays store data in tabular form, meaning in rows and columns like an Excel spreadsheet.

What lessons are included in this course?

The course includes four lessons: Declaring Two-Dimensional Arrays; Declaring and Initializing Two-Dimensional Arrays; Working with Two-Dimensional Arrays; and Working with Jagged Arrays.

What skills does this course build?

This course builds skills in C (programming language), C data types, C-based programming languages, data structures, multidimensional arrays, and working with tabular data.

How are two-dimensional arrays initialized in C?

They are initialized using the same technique used for one-dimensional arrays, but by creating a list of lists.