Trying to create a linked list but error with pointer assignment

前端 未结 1 1525
轻奢々
轻奢々 2021-01-22 03:34

I am trying to make a linked list and create some methods. However, I am getting the error:

Assignment makes pointer from integer without a cast.

相关标签:
1条回答
  • 2021-01-22 04:30

    If the error is on the commented line, then maybe ID is a pointer, not an int. This will work fine:

    students->ID = 0; 
    

    because it sets the pointer to NULL, so it compiles without error/warning.

    0 讨论(0)
提交回复
热议问题