prog.cpp:1:27: error: ‘string’ in namespace ‘std’ does not name a type
void kompresja(const std::string nazwa_pliku, const int r_wej, const int r_his, std::string& tekst)
^~~~~~
prog.cpp:1:22: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
+#include <string>
void kompresja(const std::string nazwa_pliku, const int r_wej, const int r_his, std::string& tekst)
^~~
prog.cpp:1:86: error: ‘std::string’ has not been declared
void kompresja(const std::string nazwa_pliku, const int r_wej, const int r_his, std::string& tekst)
^~~~~~
prog.cpp: In function ‘void kompresja(int, int, int, int&)’:
prog.cpp:3:7: error: ‘cout’ is not a member of ‘std’
std::cout << "Wielkosc pliku przed kompresja wynosi " << 8 * tekst.length() << " bitow" << std::endl;
^~~~
prog.cpp:3:7: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
prog.cpp:1:1:
+#include <iostream>
void kompresja(const std::string nazwa_pliku, const int r_wej, const int r_his, std::string& tekst)
prog.cpp:3:7:
std::cout << "Wielkosc pliku przed kompresja wynosi " << 8 * tekst.length() << " bitow" << std::endl;
^~~~
prog.cpp:3:69: error: request for member ‘length’ in ‘tekst’, which is of non-class type ‘int’
std::cout << "Wielkosc pliku przed kompresja wynosi " << 8 * tekst.length() << " bitow" << std::endl;
^~~~~~
prog.cpp:3:98: error: ‘endl’ is not a member of ‘std’
std::cout << "Wielkosc pliku przed kompresja wynosi " << 8 * tekst.length() << " bitow" << std::endl;
^~~~
prog.cpp:3:98: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?
prog.cpp:1:1:
+#include <ostream>
void kompresja(const std::string nazwa_pliku, const int r_wej, const int r_his, std::string& tekst)
prog.cpp:3:98:
std::cout << "Wielkosc pliku przed kompresja wynosi " << 8 * tekst.length() << " bitow" << std::endl;
^~~~
prog.cpp:5:16: error: ‘ile_bitow’ was not declared in this scope
int bity_his {ile_bitow(r_his)};
^~~~~~~~~
prog.cpp:6:7: error: ‘cout’ is not a member of ‘std’
std::cout << bity_his << std::endl;
^~~~
prog.cpp:6:7: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
prog.cpp:6:32: error: ‘endl’ is not a member of ‘std’
std::cout << bity_his << std::endl;
^~~~
prog.cpp:6:32: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?
prog.cpp:7:7: error: ‘ofstream’ is not a member of ‘std’
std::ofstream plik(nazwa_pliku);
^~~~~~~~
prog.cpp:7:7: note: ‘std::ofstream’ is defined in header ‘<fstream>’; did you forget to ‘#include <fstream>’?
prog.cpp:1:1:
+#include <fstream>
void kompresja(const std::string nazwa_pliku, const int r_wej, const int r_his, std::string& tekst)
prog.cpp:7:7:
std::ofstream plik(nazwa_pliku);
^~~~~~~~
prog.cpp:8:2: error: ‘plik’ was not declared in this scope
plik << tekst[0];
^~~~
prog.cpp:8:17: error: invalid types ‘int[int]’ for array subscript
plik << tekst[0];
^
prog.cpp:9:7: error: ‘string’ is not a member of ‘std’
std::string chwilowy(r_his, tekst[0]);
^~~~~~
prog.cpp:9:7: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
prog.cpp:10:8: error: request for member ‘insert’ in ‘tekst’, which is of non-class type ‘int’
tekst.insert(0, chwilowy);
^~~~~~
prog.cpp:10:18: error: ‘chwilowy’ was not declared in this scope
tekst.insert(0, chwilowy);
^~~~~~~~
prog.cpp:13:44: error: request for member ‘length’ in ‘tekst’, which is of non-class type ‘int’
for (int wsk_wej = r_his; wsk_wej < tekst.length();)
^~~~~~
prog.cpp:16:59: error: request for member ‘length’ in ‘tekst’, which is of non-class type ‘int’
for (int k = wsk_his; k < wsk_his + r_his && k < tekst.length(); k++)
^~~~~~
prog.cpp:17:22: error: invalid types ‘int[int]’ for array subscript
if (tekst[wsk_wej] == tekst[k])
^
prog.cpp:17:34: error: invalid types ‘int[int]’ for array subscript
if (tekst[wsk_wej] == tekst[k])
^
prog.cpp:20:33: error: invalid types ‘int[int]’ for array subscript
while ( (tekst[wsk_wej + C] == tekst[k + C]) && (wsk_wej + C < tekst.length()) && (C < r_wej) && (C < r_his))
^
prog.cpp:20:49: error: invalid types ‘int[int]’ for array subscript
while ( (tekst[wsk_wej + C] == tekst[k + C]) && (wsk_wej + C < tekst.length()) && (C < r_wej) && (C < r_his))
^
prog.cpp:20:76: error: request for member ‘length’ in ‘tekst’, which is of non-class type ‘int’
while ( (tekst[wsk_wej + C] == tekst[k + C]) && (wsk_wej + C < tekst.length()) && (C < r_wej) && (C < r_his))
^~~~~~
prog.cpp:21:31: error: request for member ‘length’ in ‘tekst’, which is of non-class type ‘int’
if ((wsk_wej+C < tekst.length()) && (k+C < tekst.length()))
^~~~~~
prog.cpp:21:57: error: request for member ‘length’ in ‘tekst’, which is of non-class type ‘int’
if ((wsk_wej+C < tekst.length()) && (k+C < tekst.length()))
^~~~~~
prog.cpp:32:32: error: invalid types ‘int[int]’ for array subscript
plik << '1' << tekst[wsk_wej] << std::endl;
^
prog.cpp:32:42: error: ‘endl’ is not a member of ‘std’
plik << '1' << tekst[wsk_wej] << std::endl;
^~~~
prog.cpp:32:42: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?
prog.cpp:39:38: error: ‘endl’ is not a member of ‘std’
plik << '0' << P << C_max << std::endl;
^~~~
prog.cpp:39:38: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?
prog.cpp:46:7: error: ‘cout’ is not a member of ‘std’
std::cout << "Wielkosc pliku po kompresji wynosi " << bity_pliku_wyj << " bitow" << std::endl;
^~~~
prog.cpp:46:7: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
prog.cpp:46:91: error: ‘endl’ is not a member of ‘std’
std::cout << "Wielkosc pliku po kompresji wynosi " << bity_pliku_wyj << " bitow" << std::endl;
^~~~
prog.cpp:46:91: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?