Hey guys,
I was working on a program where I am supposed to convert a c program to a C++ program and I was running into some trouble converting a function to a member function in a class.
I am trying to make a member function that prints out a line of encoded characters and a line of decoded characters as a key. But, I am having trouble deciding what to make the private members of my class versus the public member functions. Especially with the struct, I am not sure how to pass a struct to a class and do adjustments on it. So far, my code looks like this:

Code:
:
class Key
{
private:
    struct key_element 
    {
	char enc;
	char dec;
	int man_flag;
    };
    struct key_element key[26];

public:
     Key(struct elements[26])
     {
      int i,j;
      for(j=0;j<26;j++)
           {
                key[j]=elements[j];
           }

      for(i=0; i<26; i++)
	   {
		key[i].enc = 'a'+i;
		key[i].dec = '-';
		key[i].man_flag = 0;
	   }
       }
      ~Key(){}

      void print_key()
       {
	int i;
	printf("\n");
	printf("Encoded : ");
	for(i=0;i<26;i++)
		printf("%c ",key[i].enc);
	printf("\n");
	printf("Decoded : ");
	for(i=0;i<26;i++)
	{
		if(key[i].man_flag == 0)
			printf("%c ",key[i].dec);
	}
	printf("\n\n");
}
};
int main()
{
		Key my_key(key[26]);
		my_key.print_key();
}
When I try to do this, I get a compile error dealing with the struct being passed to the class member function. Please help me understand how to pass the struct to the class, if that is the right terminology. Thanks in advance.