summaryrefslogtreecommitdiff
path: root/C++_Demystified:_A_Self-Teaching_Guide/chapter2.ipynb
blob: a10e4f68095ea78cd8215d05a59423a971f3f238 (plain)
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
56
57
58
59
60
{
 "metadata": {
  "name": "",
  "signature": "sha256:609a5d3522e4231d9e4a78cca1d62620ebc8f02a9a5a670cc7f12a71d13447b3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 - Memory & Data Types"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 2.1, page no. 54"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import sys \n",
      "\n",
      "print \"Size of Integer is: \" + str(sys.getsizeof(int()))\n",
      "print \"Size of Float is: \" + str(sys.getsizeof(float()))\n",
      "print \"Size of Long is: \" + str(sys.getsizeof(long()))\n",
      "print \"Size of String is: \" + str(sys.getsizeof(str()))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Size of Integer is: 24\n",
        "Size of Float is: 24\n",
        "Size of Long is: 24\n",
        "Size of String is: 37\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}