Si-World

vichare的硅基世界

wp-codebox test

December3


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*********************
这里是注释
*********************/
#include 
#include 
#include 
#include 
#include "LearnFetcher.h"
 
using namespace std;
 
struct Course
{
    int ID;
    string name;
};
 
struct CourseFile
{
    int cind;
    string name;
    string url;
};
 
struct CourseList
{
    vector courses;
    void AddCourse(Course* c) {courses.push_back(c);}
    CourseList() {}
    ~CourseList() {
	    for (vector::iterator ptr = courses.begin(); ptr != courses.end(); ptr++)
        {
		    delete (*ptr);
	    }
	    courses.clear();
    }
	Course* operator [](int ind) {return courses[ind];}
	size_t size() {return courses.size();}
};
 
struct FileList
{
    vector files;
    void AddFile(CourseFile* f) {files.push_back(f);}
    FileList() {}
    ~FileList() {
	    for (vector::iterator ptr = files.begin(); ptr != files.end(); ptr++)
        {
		    delete (*ptr);
	    }
	    files.clear();
    }
	CourseFile* operator [](int ind) {return files[ind];}
	size_t size() {return files.size();}
};
posted under 我就不分类

Email will not be published

Website example

Your Comment: