Po użyciu w codeblocks metody .back() program wyświetla następujący błąd:
C:\Users\Rufin\Documents\036\main.cpp:26:5: error: 'std::__cxx11::string {aka class std::__cxx11::basic_string}' has no member named 'back'
s4.back()='!';
Kod:
#include <iostream>
#include <cstdlib>
#include<cmath>
#include <cstring>
using namespace std;
int main()
{string s1="Tekst pierwszy.";
string s4="tekst drugi";
string s2="Tekst drugi.";
string s3=s1+"\t"+s2+"\n";
cout << s3;
cout << s1.append(s2) << endl;
cout << s1.append(s2,6,5) << endl;
cout << s1.append(10,'#') << endl;
cout << s1.append(10,0x41)<< endl;
cout << s2.assign("Nowy tekst") << endl;
cout << s2.assign(s3,15,13) << endl;
cout << s2.assign(13,'#') << endl;
cout << s2.assign(13,0x42) << endl;
cout << s4.back() << endl;
s4.back()='!';
return 0;}
Problem mam także przy odczycie z dysku. Chociaż jest taki plik komputer go nie odnajduje. Proszę o pomoc