Skip to content

Commit 641c8cc

Browse files
committed
week05 update
1 parent 0425ccc commit 641c8cc

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

week05/Lecture05.pptx

-7 Bytes
Binary file not shown.

week05/examples/pointer-convert.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int * pi = new int[2]();
7+
unsigned char * pc = (unsigned char*)pi;
8+
pc[1] = 1;
9+
pc[5] = 2;
10+
cout << "pi[0] = " << pi[0] << endl;
11+
cout << "pi[1] = " << pi[1] << endl;
12+
13+
delete []pi;
14+
//delete []pc;
15+
return 0;
16+
}

0 commit comments

Comments
 (0)