ผลต่างระหว่างรุ่นของ "Adt lab/linked lists"

จาก Theory Wiki
ไปยังการนำทาง ไปยังการค้นหา
(หน้าที่ถูกสร้างด้วย ': ''This is part of adt lab'' == List nodes == == Linked list class ==')
 
แถว 2: แถว 2:
  
 
== List nodes ==
 
== List nodes ==
 +
 +
=== typedef ===
 +
 +
In C++, you can simply declare a new type based on known types using <tt>typedef</tt>.
 +
 +
typedef int valueType;
 +
...
 +
valueType x = 10;
 +
 +
We will declare new <tt>valueType</tt> so that our linked list code works fairly well with any types.  We will eventually use '''template''' to make generic linked list.
 +
 +
=== struct ===
  
 
== Linked list class ==
 
== Linked list class ==

รุ่นแก้ไขเมื่อ 22:43, 17 กันยายน 2558

This is part of adt lab

List nodes

typedef

In C++, you can simply declare a new type based on known types using typedef.

typedef int valueType;
...
valueType x = 10;

We will declare new valueType so that our linked list code works fairly well with any types. We will eventually use template to make generic linked list.

struct

Linked list class