Symbol Table Representation (2)
Fixed Length:
| Name | Type | |||||||||
| a | x | x | x | x | x | x | x | x | x | int |
| b | x | x | x | x | x | x | x | x | x | int |
| c | x | x | x | x | x | x | x | x | x | int |
| S | u | m | x | x | x | x | x | x | x | int |
| P | e | r | c | e | n | t | a | g | e | float |
| r | e | a | d | d | a | t | a | fun() | ||
| 0 | a |
| 1 | $ |
| 2 | b |
| 3 | $ |
| 4 | c |
| 5 | $ |
| 6 | s |
| 7 | u |
| 8 | m |
| 9 | $ |
| 10 | p |
| 11 | e |
| 12 | r |
| 13 | c |
| 14 | e |
| 15 | n |
| 16 | t |
| 17 | a |
| 18 | g |
| 19 | e |
| 20 | $ |
| 21 | r |
| 22 | e |
| 23 | a |
| 24 | d |
| 25 | d |
| 26 | a |
| 27 | t |
| 28 | a |
| 29 | $ |
The above tables depict the variable length.
In variable-length memory is not wasted whereas in fixed-length the memory is wasted.
| Starting Index | Length | Type |
| 0 | 2 | int |
| 2 | 2 | int |
| 4 | 2 | int |
| 6 | 4 | int |
| 10 | 11 | float |
| 21 | 9 | junction |
In fixed-length table represents the maximum name of the variable is taken and allocated memory to all variables as same.
Symbol Table Representation (2)
