log
graph
tags
bookmarks
branches
changeset
browse
file
latest
diff
comparison
annotate
file log
raw
help
Mercurial
>
lcfOS
annotate python/c3/examples/cast.c3 @ 221:
848c4b15fd0b
Find changesets by keywords (author, files, the commit message), revision number or hash, or
revset expression
.
pointers
author
Windel Bouwman
date
Mon, 08 Jul 2013 22:21:44 +0200
parents
children
rev
line source
221
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
1
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
2
/*
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
3
Demo of how to type cast
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
4
*/
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
5
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
6
package castdemo;
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
7
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
8
function int testcast()
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
9
{
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
10
var int a;
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
11
var int* b;
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
12
a = 3;
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
13
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
14
b = cast<int*>(a);
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
15
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
16
return 0;
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
17
}
848c4b15fd0b
pointers
Windel Bouwman
parents:
diff
changeset
18