diff --git a/Structures/Stucture Baics/Structure Declaration/aStructureDeclaration.cpp b/Structures/Stucture Baics/Structure Declaration/aStructureDeclaration.cpp new file mode 100644 index 0000000..16ef49a --- /dev/null +++ b/Structures/Stucture Baics/Structure Declaration/aStructureDeclaration.cpp @@ -0,0 +1,27 @@ +#include +using namespace std; + +// stducture Declaration + +struct studentDetails // struct is used to define a stucture +{ // studentDetails is structure type + int roll; + string name; // structure memebers + int age; + +}; +int main() +{ + struct studentDetails stud; // structure variable declaration + stud.age=22; + stud.name="Mimo Patra"; // accessing structure member using structure variable + stud.roll=153; + + // printing structure members + + cout<<" Structure Mmbers: "<>arr[i].number; + } + cout< +using namespace std; +struct numbers +{ + int num; +}var; +void pass(int num) // function to pass the structure member and print +{ + cout<<"Passed number: "< +using namespace std; + +//structure +struct details{ + long phnNo; +}; + +void myFun(struct details go); // function prototype declaration + +// main function +int main() +{ + struct details ph; + ph.phnNo=1234567; + myFun(ph); // passing entire structure to myFun function + + return 0; +} + +void myFun(struct details go) +{ + cout<<" Phone Number: "<