I'm writing a program that converts numbers, letters, and certain symbols to morse code, then writes them to a file. I've gotten everything but spaces to convert and write to file appropriately. Spaces are supposed to write as a / .
Here is my code to write a space to file as a / .
std::ifstream fout( filename ) ; // open the file for input
// note that filename is the name of (the path to) the file; fout is the stream that we write to
// ...
if( text[i] == ' ' ) // if the character at position i in the text is a space
fout << '/' ; // write the single character '/' to the file stream