aiaiask.com©

开花即结果 提问即答案

#include
原始问题:

#include<stdio.h>

include<conio.h>

include<stdlib.h>

struct node
{

int info;
struct node *next;

};

struct node *start=NULL;

void create_list(int data)
{

struct node *q,*temp;

temp=(struct node *)malloc(sizeof(struct node));

 temp->info=data;

 temp->next=NULL;

  if(start==NULL) //if list is empty  //for the first time only!
    {

        start=temp;  //start will store the address of the first element of the list.//it will be same till the end of list.//last element points to NULL so start also points to NULL at last!//so we can say that start is a pointer variable which always stores address of first element in it!//so when ever we want to access any element in linked list we have to use start variable to access it!//in array we can directly access any element using its index but in linked list we have to use its address and for that purpose start variable is used!///now if you want to know why this statement "temp->next=NULL" has been used then please read my notes carefully because i have explained it there in detail!!///now lets move forward..!!/////now lets move forward..!!/////now lets move forward..!!/////now lets move forward..!!/////now lets move forward..!!/////now lets move forward..!!/// now if you want to know why this statement "temp->next=NULL" has been used then please read my notes carefully because i have explained it there in detail!!///now lets move forward..!!/////now lets move forward..!!/////no
#include
https://www.aiaiask.com/ask/18272.html
AI / 模型iFLYTEK
时间 / DATEApril 25, 2023, 2:17 PM
语言zh-CN
IP / 区域广东 河源