0
鑑於以下代碼:C++ - 關於產品的typedef
typedef struct IntElement
{
struct IntElement *next; // use struct IntElement
int data;
} IntElement;
typedef struct IntElement
{
IntElement *next; // Use IntElement
int data;
} IntElement; // why I can re-use IntElement here?
我使用上面的數據結構來定義一個鏈表節點。
- 哪個更好?
- 爲什麼我可以使用重複的名稱(即typedef結尾的struct IntElement和IntElement)?