Possible duplicate:
Representation of dynamic typing in C
The professor of my lecture, “History of Computing,” studied in detail the clearly typed or printed types of languages and generally praised the greatness of language languages (faster development time, dynamic systems, etc.).
On the same day, another professor says in Automata class:
Dynamic typing makes things more complicated by adding more ways to do the same.
I use statically typed languages for most of my life: C / C ++ / Java - my only access to another is Shell Coding and Ren'Py.
My question is: can I write a simple C program that implements some of the advantages of both?
For example, I could create Unions to accept all user-driven data, for example:
typedef union { int int_type; char char_type;
I understand that the Union may jeopardize type safety, but here's what I'm trying to do here. What other approach could I take? I'm just trying to demonstrate.
I tried to answer from this question . But honestly, I couldn’t follow the arguments exactly.
Sorry if the question seems silly.
PS
Using the suggestions below, I wrote the following: http://codepad.org/A9JAX8lD , which basically doesn't do anything dynamic, but at least is a start.
I seem to see what my professors tried to say.