#include <iostream>
using namespace std;
struct massiv
{
char a[256];
char b[256];
};
int main()
massiv c;
cin.width(sizeof(c.a));
cin >> c.a;
cout<<c.a<<endl;
FILE *my_file=fopen("file.txt","r");
fgets(c.b,256,my_file);
puts(c.b);
fclose(my_file);
return 0;
}
Объяснение:
#include <iostream>
using namespace std;
struct massiv
{
char a[256];
char b[256];
};
int main()
{
massiv c;
cin.width(sizeof(c.a));
cin >> c.a;
cout<<c.a<<endl;
FILE *my_file=fopen("file.txt","r");
fgets(c.b,256,my_file);
puts(c.b);
fclose(my_file);
return 0;
}
Объяснение: