boost learn study
Tuesday, April 1, 2014
Structure within Structure (Nested Structure)
Home
�
C Structures
�
Structure within Structure
#include
#include
struct str1 //First Structure { char name[10]; struct str2 //Second Structure { city[20]; }objstr1; }objstr2; void main() { printf("Enter the Name and City\n"); scanf("%s%s",objstr1.Name,objstr2.city); printf("\nName=%s",objstr1.name); printf("\n City=%s",objstr1.objstr2.city); getch(); }
Output is as :
Enter the Name and City
Bintu
Muktsar
Name=Bintu
City=Muktsar
Read more �
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment