Difference of the following snippets

c, c++

Solution

For C++, there is no difference.

If this was a C program and you used the first variant, you could do:

Tcl_ObjType instanceOfStructure;

instead of

struct Tcl_ObjType instanceOfStructure;

Problem

Please tell me what is the difference of ``` typedef struct Tcl_ObjType { char *name; Tcl_FreeInternalRepProc *freeIntRepProc; Tcl_DupInternalRepProc *dupIntRepProc; Tcl_UpdateStringProc *updateStringProc; Tcl_SetFromAnyProc *setFromAnyProc; } Tcl_ObjType; ``` and ``` struct Tcl_ObjType { char *name; Tcl_FreeInternalRepProc *freeIntRepProc; Tcl_DupInternalRepProc *dupIntRepProc; Tcl_UpdateStringProc *updateStringProc; Tcl_SetFromAnyProc *setFromAnyProc; }; ``` I have see the first version here: http://www.tcl.tk/man/tcl8.5/TclLib/ObjectType.htm , and don't know why it is written as it is.

Original source