Two-Dimensional Array

I have a project for class to make a two-dimensional array to store the ICAO alphabet like N-November and B- bravo and so on. I have to use an array of strings which is indexed by the position of the letters in the alphabet. The program will prompt the user for a word and it will return the appropriate code for the word. I not sure how to start and i'm doing this over my break so i don't have a teacher or anyone else to ask.

I not sure how to start and i'm doing this over my break so i don't have a teacher or anyone else to ask.

Thank god for google.

http://lmgtfy.com/?q=2D+Arrays+c%2B%2B
Last edited on
I don't think you need a 2D array. You can do it lean and mean like this:
1
2
3
4
5
const char *words[26] = {
    "alpha",
    "bravo",
    "charlie",
    ...

they want it in a 2D array
For a 2D array should i be using a text file ?
const char array[26][] = { "alpha", "bravo", ... };
essentially dhayden is correct that this is basically a const char * array[].
so array[0] == "alpha" and array[0][1] == 'l'
Topic archived. No new replies allowed.