Warning: assignmentfromincompatiblepointertype

Source: Internet
Author: User
Warning: assignmentfromincompatiblepointertype -- Linux general technology-Linux technology and application information. Read the following for details. # Include
2 # include
3
4 typedef struct student stu_t, * pstu_t;
5
6 struct student
7 {
8 int id;
9 struct stu_t * next;
10 };
11
12 pstu_t create (int id)
13 {
14 pstu_t p = (pstu_t) malloc (sizeof (stu_t ));
15 p-> id = id;
16 p-> next = NULL;
17 return p;
18}
19
20 pstu_t append (pstu_t h, pstu_t t)
21 {
22
23 pstu_t p;
24 if (h = NULL)
25 return t;
26 for (p = h; p-> next! = NULL; p = p-> next)
27;
28 p-> next = t;
29 return h;
30}
31
32 void travel (pstu_t h)
33 {
34 pstu_t p;
35 for (p = h; p-> next! = H; p = p-> next)
36 {
37 printf ("id = % d \ n", p-> id );
38}
39 printf ("id = % d \ n", p-> id );
40}
41
42
43 int main (int argc, const char * argv [])
44 {
45 pstu_t head = NULL;
46 pstu_t t, tail, delp;
47 int I, count = 0;
48 // for (I = 0; I <8; I ++)
49 //{
50 // t = create (I + 1 );
51 // head = append (head, t );
52 //}
53
54 t = create (1 );
55 head = t-> next = t;
56 tail = t;
57 for (I = 1; I <10; I ++)
58 {
59 t = create (I + 1 );
60 t-> next = tail-> next;
61 tail = tail-> next = t;
62}
63 travel (head );
64 t = tail;
65 printf ("the key is :");
66 while (t-> next! = T)
67 {
68 t = t-> next;
69 count ++;
70 if (count> = 2)
71 {
72 count = 0;
73 delp = t-> next;
74 t-> next = delp-> next;
75 printf ("% d", delp-> id );
76}
77}
78 printf ("\ n ");
79 printf ("the last kill is: % d \ n", t-> id );
80 // return 0;
81}

Assignment from incompatible pointer type: What is this warning ??
Related Article

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.