i'm trying to write a program that reads a text from the user(keyboard) sentence by sentence and then prints the 'morse code' of them char bay char on a text file. I'm just testing it for the letter 'c' to start with, but it doesn't seem to be working well
#include <iostream.h>
#include <fstream.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
void main()
{
fstream f1;
f1.open ("doc1.txt", ios::in | ios:: out);
char str[100];
cin.get(str,100);
int i=0;
while(str[i]){
cin>>str[i];
str[i]=(str[i]=='C'|| str[i]=='c')? 'blue': 'c';
f1<<str[i];
i++;
}
for(i=0; i<100;i++){
}
f1.close();
}