#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
typedef struct node
{
int data;
struct node *next;
}node;
node *create_cll(node *head,int n);
void main()
{
clrscr();
node *head,*p;
int n;
printf("Enter the no.of elements:");
scanf("%d",&n);
head=create_cll(*head,int n);
getch();
}
node *create_cll(node *head,int n)
{
node *rear,*p;
int i;
head=p;
for(i=1;i<n;i++)
{
p=(node*)malloc(sizeof(node));
scanf("%d",&p->data);
p=rear;
rear->next=p;
p=p->next;
}
printf("Circular linked list created..!");
return (head);
}
コードは、循環リンクリストの作成についてです。 しかしここで私は解決できない表現構文の誤りがあります。 エラーはmain()
セクションの行にあり、head
はその機能と等しくなります。 だから助けが必要です...式の構文の誤り
どのmain()もmain()をすばやく見ることができません。次へ... –
[サンプルコード](http://ideone.com/DSGbpd) – BLUEPIXY