-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.cpp
More file actions
51 lines (50 loc) · 987 Bytes
/
4.cpp
File metadata and controls
51 lines (50 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <fstream>
using namespace std;
void store(string input);
void data();
main()
{
string input;
cout << "Enter A String: ";
getline(cin, input);
store(input);
data();
}
void store(string input)
{
fstream newfile;
newfile.open("data.txt", ios::out);
newfile << input << endl;
newfile.close();
}
void data()
{
int index = 0;
string input;
fstream file;
file.open("string.txt", ios::in);
getline(file, input);
int length = sizeof(input) / sizeof(input[0]);
for (int idx = 0; idx < length; idx++)
{
if (input[idx] == '\"')
{
index = idx;
break;
}
}
for (int i = index; i < 12334; i++)
{
if (input[i + 1] == '\"')
{
cout << input[i] << "\"";
break;
}
else
{
cout << input[i];
}
}
file.close();
}