The program is showing errors because there are errors...
Please note you don't need to
typedef struct
s in
C++
.
Try
#include<iostream>
using namespace std;
struct stud
{
int rno;
stud *s;
};
int main()
{
stud * s = new stud();
s->rno=30;
s->s = nullptr;
cout << s->rno <<endl;
delete s;
return 0;
}