Skip to content

Instantly share code, notes, and snippets.

@Vitka999
Vitka999 / Client.cpp
Created March 25, 2026 12:03
Потужний чат
#include <iostream>
#include <string>
#include <thread>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#pragma comment(lib, "ws2_32.lib")
using namespace std;
@Vitka999
Vitka999 / Client
Created March 23, 2026 10:54
Чат на TCP
#include <ws2tcpip.h>
#include <iostream>
#include <string>
using namespace std;
#pragma comment (lib, "Ws2_32.lib")
#define MESSAGE_LENGTH 4096
#define SERVER_IP "127.0.0.1"
#define SERVER_PORT "8888"
@Vitka999
Vitka999 / Автомобиль
Created March 23, 2026 10:49
Сложный автомобиль
#include <iostream>
#include <string>
using namespace std;
class Cloneable {
public:
virtual ~Cloneable() = default;
virtual Cloneable* clone() const = 0;
};
@Vitka999
Vitka999 / Client
Created March 17, 2026 08:08
TcpUdpKursValut
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#include <iostream>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <string>
#pragma comment(lib, "ws2_32.lib")
using namespace std;
#include <iostream>
#include <string>
using namespace std;
class Herbivore
{
public:
int weight;
bool life;
@Vitka999
Vitka999 / client.cpp
Created February 26, 2026 10:39
C++(сокеты)
#define _WIN32_WINNT 0x0601
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iostream>
#include <string>
#include <iostream>
#include <winsock2.h>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
using namespace std;
#include <iostream>
using namespace std;
enum Menu
{
PLUS = 101,
MINUS = 102,
DIVIDE = 103,
MULT = 104,
EXIT = 0
};