I've been working on a project to convert user inputted Morse Code to text i.e. convert ".- " to A etc. I'm not sure what is wrong with the program/how to fix it. Here is the code I have so far:

Code:
#include <iostream>
#include <iomanip>
#include <string>
#include <windows.h>

using namespace std;



// Declares a structure of 2 parts - Character and string.
struct Code{   
	char letter;
	string morse;	
};
// Array of the structure Code.
Code convert[] ={   
	{ 'A', ".- "   },{ 'B', "-... " },{ 'C', "-.-. " },
	{ 'D', "-.. "  },{ 'E', ". "    },{ 'F', "..-. " },
	{ 'G', "--. "  },{ 'H', ".... " },{ 'I', ".. "   },
	{ 'J', ".--- " },{ 'K', "-.- ", },{ 'L', ".-.. " },
	{ 'M', "-- "   },{ 'N', "-. "   },{ 'O', "--- ", },
	{ 'P', ".--."  },{ 'Q', "--.- " },{ 'R', ".-. "  },
	{ 'S', "... "  },{ 'T', "- "    },{ 'U', "..- "  },
	{ 'V', "...- " },{ 'W', ".-- "  },{ 'X', "-..- " },
	{ 'Y', "-.-- " },{ 'Z', "--.. " },{ '0', "-----" },
	{ '1', ".----" },{ '2', "..---" },{ '3', "...--" },
	{ '4', "....-" },{ '5', "....." },{ '6', "-...." },
	{ '7', "--..." },{ '8', "---.." },{ '9', "----." },
	{ '?', "..--.. " },{ '!', "-.-.-- "},{ '$', "...-..- "}
}; 

void convert_to_morse2(string);	
void morse_out(string);			

void convert_to_morse(char *);	
void morse(char *);		

int main () 
{
	char str[100];
	string text;


	
	cout << "Enter morse code to convert to a string: " ;
	getline(cin, text);
	convert_to_morse2(text);

	system("pause");
	// terminate program
	return 0;

}



void convert_to_morse2(string s)
{   
	int i, j;  

	
	for ( i = 0; i < s.length(); i++ )		
	{      
		
		for ( j = 0; j < 38; j++ )      
		{         
			// Convert characters in s to uppercase before checking for them
			if ( toupper(s[i]) == convert[j].letter )         
			{            
				letter_out(convert[j].letter);	
				break;         
			}      
		}   
	}   

	cout << "\n";
} 

void letter_out(string str)
{
	int lcv;
	char ch;

	for (lcv = 0; lcv != str.length(); lcv++)	// keep going until the end (0x00) is reached 
	{
		ch = str[lcv];
		cout << ch;	// Display on screen;
	

	}
}


The error I get is "error C3861: 'letter_out': identifier not found" but I can't see why this is happening. Any help is very much appreciated.