summaryrefslogtreecommitdiff
path: root/Practical_C_Programming/Chapter_12_1.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Practical_C_Programming/Chapter_12_1.ipynb')
-rw-r--r--Practical_C_Programming/Chapter_12_1.ipynb41
1 files changed, 41 insertions, 0 deletions
diff --git a/Practical_C_Programming/Chapter_12_1.ipynb b/Practical_C_Programming/Chapter_12_1.ipynb
new file mode 100644
index 00000000..b711a066
--- /dev/null
+++ b/Practical_C_Programming/Chapter_12_1.ipynb
@@ -0,0 +1,41 @@
+{
+ "metadata": {
+ "name": "Chapter 12"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "Chapter 12: Advanced types"
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": "Example 12.1, Page number: 212"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "# Example 12.1.py\n# To illustrate the use of a 'union'\n\n\n# Union declaration\nfrom ctypes import *\nclass value (Union) :\n _fields_ = [(\"i_value\", c_int),\n (\"f_value\", c_float)]\n\n# Calculation and result\ndata = value (3, 5.0)\nprint (data.i_value, data.f_value)",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "(1084227584, 5.0)\n"
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file