We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c53f6ef commit 0861e9eCopy full SHA for 0861e9e
getline.cpp
@@ -6,8 +6,15 @@ int main() {
6
char * napis = new char[128];
7
8
cout<<"Napiz cos: ";
9
- cin.getline(napis, 128);
+ cin.getline(napis, 128); //zmienna i dlugosc przchwytywanych danych
10
cout<< napis<<endl;
11
12
+ ofstream zapis;
13
+ zapis.open("plik.txt", ofstream::app); //append czyli dopisywnaie nie nadpisywanie
14
+ zapis<<napis<<endl;
15
+
16
+ zapis.close();
17
+ delete [] napis;
18
19
return 0;
20
}
0 commit comments