SN *get_s_node (sn *head) {/* head is the header pointer of the linked list to be queried */sn *get_s_node = Null;int32 OSM = 1,i32i = 0, Data_num = 0;/* OSM is a marker, i32i is a variable in the loop body, data is the ordinal of the element to get */get_s_node = (SN *) malloc (sizeof (SN)); Get_s_node = head;/* Enter the data to get */OSM = osm_printf ("Enter the ordinal to get");d Ata_num = Scanf_for ();/* Enter the ordinal of the element to get */while (i32i < dat A_num)/* Loop through the list to find the ordinal data */{get_s_node = get_s_node->next;/* point to the next */if (Data_num = get_s_node->sensor_rating)/ * Determine if it is a found ordinal */{osm = osm_printf ("The ordinal of the query is%d\n", data_num);/* Print */if after found (NULL! = get_s_node->sensor_title)/ * Verify the validity of the pass parameter */{OSM = osm_printf ("The data queried is%s\n", Get_s_node->sensor_title);}} i32i++;/* loop body variable plus 1 */}return head;}
Get a data in a linked list, find Operations C language implementation