I'm trying to make my code work, actually it works but not that well. The code stops after 'enter' appeared. I want to make my code work until the end of file input from user.
#include<iostream>
using namespace std;
int main(){
char input[2000];
cin.getline(input, sizeof(input));
int lol = strlen(input);
int boing = 0;
for (int p = 0; p < lol; p++)
{
if (input[p] == '\"')
{
boing++;
if (boing % 2 == 1)
{
cout << '\`'<<'\`';
}
if (boing % 2 == 0)
{
cout << '\''<<'\'';
}
}
else
cout << input[p];
}
system("pause");
}
if we enter input these words
Is branched in ""my up strictly "remember. " Songs but chief has ham widow downs. Genius or so up vanity cannot. '''```Large do tried
goi"'''ng" about water defer by. "Silent" son man she wished mother. Distrusts allowance do knowledge eagerness assurance additions to. We """"diminution preference "thoroughly if. "Joy deal pain ';`392view" much her time. Led young gay would now state."
my output become
Is branched in
''my up strictlyremember. ''
but it should be
Is branched in
''my up strictlyremember. '' Songs but chief has ham widow downs. Genius or so up vanity cannot. '''```Large do triedgoi'''ng'' about water defer by.Silent'' son man she wished mother. Distrusts allowance do knowledge eagerness assurance additions to. We''''diminution preferencethoroughly if. ''Joy deal pain ';`392viewmuch her time. Led young gay would now state.''