Hi again!
My code is not finished, but heres a pretty good start to what I am trying to do
Code
#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>
using namespace std;
string texttomor (string, string[]);
int main()
{
char text[26] = {'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'};
string morse[] = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."};
string code, morsecode;
char choice; // ignore for now
char repeat = 'y' || 'Y'; // ignore for now
int lengthoftext=code.length();
{
cout << "Enter code to translate: " << endl;
getline(cin, code);
cout << "Text: " << code << endl;
cout << "Morse: " << texttomor(code, morse) << endl;
}
return 0;
}
string texttomor (string code, string morse[])
{
int codelength = code.length();
string spacesBetweenLetters = " ";
string spacesBetweenWords = " ";
for(int k=0; k<codelength; k++)
{
if(code[k]!= ' ')
code[k]=toupper(code[k]);
spacesBetweenLetters += morse[code[k] - 'A'];
spacesBetweenLetters+= " ";
if(code[k]==' ')
spacesBetweenWords+= morse[code[k]-'A'];
spacesBetweenWords+= " ";
}
return spacesBetweenLetters;
}
This compiles fine, but here is my issue:
When I input a single word, it converts it to morse code no problem.. but if I do two words with a space, it does a core dump.
I'm also in search of some help doing MORSE to ENGLISH... I've tried a few ways, but have been very unsuccessful, so any help is appreciated

*** For this project, I have to use cin.get... right now its getline, but I'm going to deal with that at some other point.
Also, I am trying to use C strings instead of C++ strings, so I'm still figuring all that shit out too
This post was edited by Rws on Feb 28 2016 01:04am