Что не так или как создать стек символов?
Код: Выделить всё
struct steck {
char c[10];
struct steck *next;
}*p1,*p2;
static int a,n;
void main(){
p2=NULL;
p1=new(struct steck);
printf("Razmer;"); scanf("%i",&n);
if(n==NULL) printf("error");
else{
for(a=0;a<n;a++)
{
scanf("%s",&p1->c);
p1->next=p2;
p2=p1;
}
printf("Elements:\n");
if(p1!=NULL)
{
printf(" %s",p1->c);
p2=p1->next;
//delete(p1);
p1=p2;
}
getch();
}}