カテゴリー
C++

C++コード張り付けてみる、utf-8ふぁいるだったら

#pragma once

#include <stdio.h>
#include <string.h>

class Link {
	friend class List;
	Link* next;
	char item[20];

public:
	Link(const char* x = "") { 
		strcpy_s(item, x);
		next = NULL;
	}
	Link* Next(void) { return (next); }
	void LinkPrint(void) { printf("%s\n", item); }
};

class List {
protected:
	Link* first;
	Link* last;
public:
	List(void) { first = last = new Link; }
	~List() { Clear(); delete first; }
	List& Insert(const Link&);
	List& Append(const Link&);
	List& Delete(void);
	List& Remove(void);
	List& Clear(void);
	void Print(void);
};

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

inserted by FC2 system