I am currently implementing a linked list which will store an array of stars in each node. I am trying to return those strings back to the main. The code for the structure is
# MAX_LINE 80 Typedf Structure Node {char things [MAX_LINE / 2] [MAX_LINE]; Structure node * link; } Node;
More questions in question
char ** getThings (node * head, int position) {if (position == 1) {return head - & Gt; Things; } Int i = 1; While (head- gt; link! = Null) {head = head-> Link; I ++; If (i == position) {return head-> things; However, the error is "Warning: Returning from Incompatible Notification Type. I have seen the array and the returning arrays in dynamic allocation but it is not able to understand linked list access. Is it possible to take out each of the elements Should and should be inserted into a dynamic allocated array and if so how?
You get the getThings
Try
# to the right type Should be returned MAX_LINE 80 typed variable (* thing_t) [MAX_LINE]; chess_t getThings (node * head, status of int) {if (position == 1) {return head- gt; things;} int i = 1; While {head-> link! = NULL} {head = head-> gt; i ++; if (i == position) {return head- gt; things;}}
< / Div>
Comments
Post a Comment