#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct clink {
int info;
struct clink * next;
};
struct clink * start;
void create();
void display();
void main();
{
[SHOWING ERROR IN THIS LINE "Declaration terminated incorrectly"]
struct clink *p. *q.
char ch;
clrscr();
start=(struct clink *) malloc (size of(struct link));
printf("in ent the info;")
scanf(%d,& start->info);
do {
p=start
printf("in do you wish o continue:");
ch=getch();
if(ch='y') {
create(p);
}
}
while(ch!='n');
diplay ();
}
void create(struct clink *p)
{
struct clink * q;
do {
p=p-> next;
}
while(p->next!=start);
q=(struct link*)malloc(size of (struct clink));
printf("in ent the info");
scanf("%d",& q->info);
q->next=start;
p->next=q;
}
void display()
{
int i;
=1
struct clink *p
p=start;
do {
print("in the element at pos%d,"i,position);
i++;
p=p->next;
}
while (p)=start);
}
ROCK_ST@R 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.