By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,670 Members | 1,526 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,670 IT Pros & Developers. It's quick & easy.

how to define struct within struct

P: 1
i have problem in define struct within struct


struct student_detail
{
int id;
string name;
};

struct subject_detail
{
double ass1, ass2;
double test1, test2;
double totalass, totaltest, totalfinal;
double coursework, result, final;
char grade;
};

struct student_subject
{
student_detail record;
subject_detail details[3];
} student_Record[2];


when i was write like this, i see the error say my struct student_subject have problem but i donno what is the problem , so i hope can find the solution about this , thanks
Nov 18 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 671
1. Use CODE tags. Forum rules. And we also require them to read code properly.

2. Mind telling us precisely what that error was? It's not very hard to use copy and paste.
Nov 18 '07 #2

AHMEDYO
100+
P: 112
HI...

i cant find any error with your code except you may be didnt include specified header file for string class, your code working good with VC++ 6.0, may be you can tell us what version you use and the error description


Many thanx.
Nov 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.