Linked list C++ help

Hi everyone!
So I have this homework to do for next week. I'm a beginner in programming but so far I knew about 90% of questions in homework. I have 2 questions left and I'm not sure if they are right so I was wondering if someone can help me, or corect my mistakes. Here are the questions:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class L_5_s{
public:
  int key;
  float first;
  char third[37];
  float sixth;
  int forth;
  void input(){
    cout << "key: "; cin >> key;
    cout << "first: "; cin >> first;
    cout << "third: "; cin >> third;
    cout << "sixth: "; cin >> sixth;
    cout << "forth: "; cin >> forth;
  };
  void print(){
    cout << "key: " << key << endl;
    cout << "first: " << first << endl;
    cout << "third: " << third << endl;
    cout << "sixth: " << sixth<< endl;
    cout << "forth: " << forth<< endl;
  };
};


47. How much memory space do objects from class L_5_s 'occupy', and how much does the head of the linked list from example?
Do I use sizeof here or something else? Is this OK? : cout << sizeof(L_5_s) << endl;

49. Define a static field of 37 elements from the class L_5_s.
I really don't understand this question.
I do not see here a linked list.:) As for the size of an object of type L_5_s then it is enough to use sizeof operator.
I think that there is speaking about making data member
char third[37] static.

Yeah, I agree with vlad from moscow
Linked lists have this syntax:

1
2
3
4
5
struct <name>
{
     <data type> <valid identifier>
     <name>* <valid IDer>
}


eg:
1
2
3
4
5
6
struct DATA
{
     int age;
     string name;
     DATA* next;
}


HTH,
Aceix.
I don't speak english well, so I think I translated this wrong :D
Topic archived. No new replies allowed.