Прога на C++ (проблема с файлом)
char name[100];
char text[100];
cout<<"way for file and file name:\n";
cin>>name;
ofstream out(name);
cout<<"vvedite text:\n";
cin>>text;
out<<text;
gets(text);
out<<text;
out.close();
char str1[100] = {0};
char str[100];
int k = 0,strt,fnsh;
ifstream fil(name);
while ( !fil.eof() ) {
fil >> str;
char c = fil.get();
fil >> str; }
for(int i = 0;i < strlen(str);i++)
{
if(str == '(')
strt = i;
if(str == ')')
fnsh = i;
}
for(int i = 0;i < strt;i++)
{
str1[k] = str;
k++;
}
for(int i = fnsh+1;i < strlen(str);i++)
{
str1[k] = str;
k++;
}
fil.close();
ofstream (name);
out<<str1;
out.close();