Here is a starter. I would create a structure for the two strings, then array of that structure.
#include <iostream>
using namespace std;
struct states
{
char *stname;
char *stabbr;
};
states st[] = { /* State abbreviation*/
"North Carolina", "NC",
"South Carolina", "SC",
"Georgia", "GA",
"Florida", "Fl",
"Alabama", "Al",
};
int main(int argc, char* argv[])
{
int array_size = sizeof(st) / sizeof(st[0]);
for(int i = 0; i < array_size; ++i)
{
cout << st[i].stname << "\t" << st[i].stabbr << endl;
}
return 0;
}
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Offline 21,961 posts
since Aug 2005