473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how to define struct within struct

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
2 2735
oler1s
671 Expert 512MB
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
112 100+
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

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

Similar topics

7
by: Morgan Cheng | last post by:
Hi, In my program module, there are some Constants should be defined to be integer key value of std::map. In the module, methods of a few classes will return std::map containing value indexed by...
3
by: theotyflos | last post by:
Hi all, I have the following: /*--- SNIP ---*/ typedef struct Argument_s { char *address; int type;
42
by: baumann | last post by:
hi all, typedef int (*pfunc)(int , int); pfunc a_func; i know it's ok, but how can define a_func without typedef statement? thanks .
5
by: Daniel Rudy | last post by:
What is the purpose of having a #define inside a struct? typedef struct { uByte bLength; uByte bDescriptorType; uWord wTotalLength; uByte bNumInterface;...
7
by: Daniel Rudy | last post by:
Is the following code legal? typedef stuct data_type_tag { int var1; int var2; int var3; struct { void *p; size_t size; unsigned int flags;
2
by: JH Trauntvein | last post by:
I recently tried an experiment to see if I could define a functor within a class method as shown here: #include <list> #include <algorithm> #include <iostream> class MyClass {
12
by: djhong | last post by:
Following is a snippet of a header file. Here, #define are inside struct evConn{} Any advantage of putting them inside struct block? Looks like there is no diff in scoping of each...
4
by: _mario.lat | last post by:
for struct: struct in6_addr { uint8_t s6_addr; }; is provided a costant: #define IN6ADDR_LOOPBACK_INIT {{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}}} what does means {{{, and }}}?
23
by: anon.asdf | last post by:
Hello! In the following code-snippet, is it possible to initialize each element of arr, with STRUCT_INIT? struct mystruct { int a; char b; };
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.