-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
44 lines (40 loc) · 875 Bytes
/
Copy pathtest.cpp
File metadata and controls
44 lines (40 loc) · 875 Bytes
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
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <ctime>
#include <fstream>
#include <cmath>
#include <cstring>
#include <string.h>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
using std::ifstream;
using std::ofstream;
using std::cin;
using std::vector;
using std::list;
#define ENDING '\0'
typedef struct Pod {
int aaa; char bbb;
int init();
} Pod;
int Pod::init() {
aaa = 0;
bbb = '@';
}
int main(void) {
Pod *tmpa[20];
for (int tmpi = 0; tmpi < 20; tmpi++) tmpa[tmpi] = new Pod;
for (int tmpi = 0; tmpi < 20; tmpi++) {
printf("[%d, %d]\n", tmpi, tmpa[tmpi]);
delete tmpa[tmpi];
}
memset(tmpa, 0, sizeof(Pod *) * 20);
for (int tmpi = 0; tmpi < 20; tmpi++) {
if (tmpa[tmpi] == NULL)
printf("[%d, %d]\n", tmpi, tmpa[tmpi]);
}
}