Language: C++

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;

void drawKochCurve(Point *p1, Point *p2, int n, int cnt);

double calc12(double p1, double p2)
{
	return (p2 + p1) / 2;
}

double calc13(double p1, double p2)
{
	return (p2 - p1) / 3 + p1;
}

double calc23(double p1, double p2)
{
	return (p2 - p1) * 2 / 3 + p1;
}

//////
class Point {
public:
	double x;
	double y;
	Point *p_next = NULL;
	Point(double x, double y);
	void Point::link(Point *p_newp);
};

Point::Point(double x, double y) {
	Point::x = x; Point::y = y;
}

void Point::link(Point *p_newp)
{
	p_newp->p_next = p_next;
	p_next = p_newp;
}

//////
class PointS : public Point {
public:
	PointS(Point *p1, Point *p2);
};

PointS::PointS(Point *p1, Point *p2)
{
	x = calc13(p1->x, p2->x);
	y = calc13(p1->y, p2->y);
	p1->link(this);
}

//////
class PointT : public Point {
public:
	PointT(Point *p1, Point *p2);
};

PointT::PointT(Point *p1, Point *p2)
{
	x = calc23(p1->x, p2->x);
	y = calc23(p1->y, p2->y);
	p1->link(this);
}

//////
class PointU : public Point {
public:
	PointU(Point *p1, Point *p2);
};

PointU::PointU(Point *p1, Point *p2)
{
	//???
	if (p1->y == p2->y && p1->x < p2->x) {
		x = calc12(p1->x, p2->x);
		y = (p2->x - p1->x) / 2 * tan(1 / 6);
		//
	}
	else if (p1->y > p2->y && p1->x < p2->x) {
		x = p2->x;
		y = calc23(p2->y, p1->y);
		//
	}
	else if (p1->y > p2->y && p1->x > p2->x) {
		x = p1->x;
		y = calc13(p2->y, p1->y);
		//???
	}
	else if (p1->y == p2->y && p1->x > p2->x) {
		x = calc12(p2->x, p1->x);
		y = (p1->x - p2->x) / 2 * (-tan(1 / 6));
		//
	}
	else if (p1->y < p2->y && p1->x > p2->x) {
		x = p2->x;
		y = calc13(p1->y, p2->y);
		//
	}
	else if (p1->y < p2->y && p1->x < p2->x) {
		x = p1->x;
		y = calc23(p1->y, p2->y);
	}
	p1->link(this);
}

//////
int main(void)
{
	int n;
	cin >> n;

	Point p1(0, 0);
	Point p2(100, 0);
	p1.p_next = &p2;

	drawKochCurve(&p1, &p2, n, 0);

	Point *p_p = &p1;

	for (p_p != NULL) {
		cout << p_p->x << " " << p_p->y << endl;
		p_p = p_p->p_next;
	}

	return 0;
}

void drawKochCurve(Point *p1, Point *p2, int n, int cnt)
{
	if (cnt >= n) return;

	PointS *ps = new PointS(p1, p2);
	PointT *pt = new PointT(p1, p2);
	PointU *pu = new PointU(p1, p2);

	cnt++;

	drawKochCurve(p1, ps, n, cnt);
	drawKochCurve(ps, pu, n, cnt);
	drawKochCurve(pu, pt, n, cnt);
	drawKochCurve(pt, p2, n, cnt);
}

Compiler output:
a.cc:8:6: error: variable or field 'drawKochCurve' declared void
    8 | void drawKochCurve(Point *p1, Point *p2, int n, int cnt);
      |      ^~~~~~~~~~~~~
a.cc:8:20: error: 'Point' was not declared in this scope
    8 | void drawKochCurve(Point *p1, Point *p2, int n, int cnt);
      |                    ^~~~~
a.cc:8:27: error: 'p1' was not declared in this scope; did you mean 'y1'?
    8 | void drawKochCurve(Point *p1, Point *p2, int n, int cnt);
      |                           ^~
      |                           y1
a.cc:8:31: error: 'Point' was not declared in this scope
    8 | void drawKochCurve(Point *p1, Point *p2, int n, int cnt);
      |                               ^~~~~
a.cc:8:38: error: 'p2' was not declared in this scope
    8 | void drawKochCurve(Point *p1, Point *p2, int n, int cnt);
      |                                      ^~
a.cc:8:42: error: expected primary-expression before 'int'
    8 | void drawKochCurve(Point *p1, Point *p2, int n, int cnt);
      |                                          ^~~
a.cc:8:49: error: expected primary-expression before 'int'
    8 | void drawKochCurve(Point *p1, Point *p2, int n, int cnt);
      |                                                 ^~~
a.cc:32:14: error: extra qualification 'Point::' on member 'link' [-fpermissive]
   32 |         void Point::link(Point *p_newp);
      |              ^~~~~
a.cc: In constructor 'PointS::PointS(Point*, Point*)':
a.cc:51:36: error: no matching function for call to 'Point::Point()'
   51 | PointS::PointS(Point *p1, Point *p2)
      |                                    ^
a.cc:35:1: note: candidate: 'Point::Point(double, double)'
   35 | Point::Point(double x, double y) {
      | ^~~~~
a.cc:35:1: note:   candidate expects 2 arguments, 0 provided
a.cc:26:7: note: candidate: 'constexpr Point::Point(const Point&)'
   26 | class Point {
      |       ^~~~~
a.cc:26:7: note:   candidate expects 1 argument, 0 provided
a.cc:26:7: note: candidate: 'constexpr Point::Point(Point&&)'
a.cc:26:7: note:   candidate expects 1 argument, 0 provided
a.cc: In constructor 'PointT::PointT(Point*, Point*)':
a.cc:64:36: error: no matching function for call to 'Point::Point()'
   64 | PointT::PointT(Point *p1, Point *p2)
      |                                    ^
a.cc:35:1: note: candidate: 'Point::Point(double, double)'
   35 | Point::Point(double x, double y) {
      | ^~~~~
a.cc:35:1: note:   candidate expects 2 arguments, 0 provided
a.cc:26:7: note: candidate: 'constexpr Point::Point(const Point&)'
   26 | class Point {
      |       ^~~~~
a.cc:26:7: note:   candidate expects 1 argument, 0 provided
a.cc:26:7: note: candidate: 'constexpr Point::Point(Point&&)'
a.cc:26:7: note:   candidate expects 1 argument, 0 provided
a.cc: In constructor 'PointU::PointU(Point*, Point*)':
a.cc:77:36: error: no matching function for call to 'Point::Point()'
   77 | PointU::PointU(Point *p1, Point *p2)
      |                                    ^
a.cc:35:1: note: candidate: 'Point::Point(double, double)'
   35 | Point::Point(double x, double y) {
      | ^~~~~
a.cc:35:1: note:   candidate expects 2 arguments, 0 provided
a.cc:26:7: note: candidate: 'constexpr Point::Point(const Point&)'
   26 | class Point {
      |       ^~~~~
a.cc:26:7: note:   candidate expects 1 argument, 0 provided
a.cc:26:7: note: candidate: 'constexpr Point::Point(Point&&)'
a.cc:26:7: note:   candidate expects 1 argument, 0 provided
a.cc: In function 'int main()':
a.cc:122:9: error: 'drawKochCurve' was not declared in this scope
  122 |         drawKochCurve(&p1, &p2, n, 0);
      |         ^~~~~~~~~~~~~
a.cc:126:25: error: expected ';' before ')' token
  126 |         for (p_p != NULL) {
      |                         ^
a.cc:131:9: error: expected primary-expression before 'return'
  131 |         return 0;
      |         ^~~~~~
a.cc:129:10: error: expected ';' before 'return'
  129 |         }
      |          ^
      |          ;
  130 | 
  131 |         return 0;
      |         ~~~~~~
a.cc:131:9: error: expected primary-expression before 'return'
  131 |         return 0;
      |         ^~~~~~
a.cc:129:10: error: expected ')' before 'return'
  129 |         }
      |          ^
      |          )
  130 | 
  131 |         return 0;
      |         ~~~~~~
a.cc:126:13: note: to match this '('
  126 |         for (p_p != NULL) {
      |             ^