This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class kontener | |
{ | |
int *T, n; | |
public: | |
kontener(int n_) : T(new int[n_]), n(n_) | |
{ | |
std::cout << "tworzenie kontenera o poj. " << n << " pod adresem: " << reinterpret_cast<const void*>(this) << "\n";; | |
} | |
kontener(const kontener& zrodlo) : T(new int[zrodlo.pobierz_n()]), n(zrodlo.pobierz_n()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sqlite3.h> | |
#include <string> | |
int callback(void *nu, int argc, char **argv, char **colName) | |
{ | |
for (int i = 0; i < argc; ++i) | |
{ | |
std::cout << colName[i] << " = "; | |
if (argv[i]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MODULE_BASE_HPP | |
#define MODULE_BASE_HPP | |
class ModuleBase | |
{ | |
public: | |
virtual void run() = 0; | |
}; | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dlfcn.h> | |
#include <iostream> | |
int main(int argc, char ** argv) | |
{ | |
if (argc == 1) | |
{ | |
std::cerr << "Usage: " << argv[0] << " modules...\n"; | |
return 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
using namespace std; | |
class Parser | |
{ | |
private: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CXX=g++ | |
CXXFLAGS=-std=c++11 -g -DDEBUG -Wall | |
APPSFLAGS=-fPIC -shared | |
OBJS=shell_main.o shell.o | |
APPS=concat_application.so echo_application.so | |
LIBS=-ldl | |
TARGET=shell | |
all: $(OBJS) $(APPS) | |
$(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $(TARGET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CyclicIterator | |
* Cyclic iterator for STL containers. | |
* @author Kacper Kołodziej | |
* @url http://kacperkolodziej.com/ | |
* @email kacper@kolodziej.in | |
*/ | |
#ifndef CYCLIC_ITERATOR_HPP | |
#define CYCLIC_ITERATOR_HPP | |
#include <iterator> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// na początku | |
#include <algorithm> | |
#include <string> | |
std::string str; // w nim masz tekst | |
std::transform(str.begin(), std.end(), str.begin(), ::tolower); | |
// taki zabieg dla obu stringów i porównujesz | |
// jeżeli chcesz zmieniony tekst mieć w drugim stringu, to: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wezel* a; | |
Wezel* b; | |
int tmp = a->dane; | |
a->dane = b->dane; | |
b->dane = tmp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
przyklad: przyklad.cpp | |
g++ przyklad.cpp -o run | |
g++ przyklad.cpp -o run_o1 -O1 | |
g++ przyklad.cpp -o run_o2 -O2 | |
g++ przyklad.cpp -o run_o3 -O3 | |
suma: suma.cpp | |
g++ suma.cpp -o suma | |
g++ suma.cpp -o suma_o1 -O1 | |
g++ suma.cpp -o suma_o2 -O2 |