c&c++ type definition typedef

Source: Internet
Author: User

1. Disclaimer

1.1 Structure Declaration:

1     struct {2         int N; 3         Double x, y; 4     };

1.2 declaration with a structural mark

1     struct point{2         Double x, y; 3     };

1.3 Defining the structure type

1.3.1 with no structural markings

struct {point    Center;     Double radius;} CIRCLE;

1.3.2 with structural signs

struct node{    int  data;     struct Node *next;} Node;

2. Defining Structure variables

1 struct point pt1,pt2;  The description form of struct point is also treated as a type

1     struct {2         int N; 3         Double x, y; 4     } St1, St2;

3 Summary

3.1 Structural symbols

struct Node is equivalent to struct {...}

3.2 typedef

typedef struct node node; Replace struct node with node

4 analysis

struct btnode{    int  data;     struct Btnode *lchild;     struct Btnode *rchild;} Btnode,*btnode;

Btnode * p is equivalent to Btnode p;

c&c++ type definition typedef

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.