Help!!!!!! Read access conflicts
Code is
#include
#include
#include
Typedef struct linknode {
Char data;
Struct linknode * next;
} listack;
Void initstack (listack * s) {
S=(listack *) malloc (sizeof (listack));
S - & gt; Next=NULL;
}
Int listackempty (listack * s) {
If (s - & gt; Next==NULL)
return 0;
The else
{
return 1;
}
}
Void listackpush listack * s, char (a) {
Listack * q;
Q=(listack *) malloc (sizeof (listack));
Q - & gt; Data=https://bbs.csdn.net/topics/a;
Q - & gt; Next=s - & gt; next;
S - & gt; Next=q;
}
Bool listackpop (listack * s, char & amp; A) {
Listack * q;
Q=(listack *) malloc (sizeof (listack));
Q=s - & gt; next;
A=q - & gt; The data; //here said the compiler caused abnormal: read access rights conflict, the q is 0 XCCCCCCCC,
S - & gt; Next=q - & gt; next;
Free (q);
return true;
}
Int main () {
Char a;
Listack s;
Initstack (& amp; S);
For (a='a'; A. & lt;=126; {+)
Listackpush (& amp; S, a);
}
While (listackempty)
{
Char b;
Listackpop (& amp; S, b);
Putchar (b);
}
printf("\n");
system("pause");
return 0;
}
To solve the thank you!!!!! CodePudding user response:
No value given for s next CodePudding user response:
The