Category : array-of-structures

I have declared a structure variable which is a dynamic array of another structure but the program crashes every time. Where am I doing wrong? What are the necessary steps to be taken? I am using DEVC++. #include<iostream> #include<cstdlib> using namespace std; struct Project{ int pid; string name; }; struct employee{ int eid; string name; ..

Read more

this is my sample code which is similar to my project, to simplify I created this dummy program. #include <iostream> using namespace std; struct str1{ int a1; }; void fun(str1 *x); int main() { str1 s; fun(&s); cout<<"print "<<s.a1<<endl; return 0; } void fun(str1 *x){ struct test{int c1;}tst; tst.c1 =7; for(int i= 0; i<9;i++){ x->a1=tst.c1; ..

Read more