dynamic struct array error

I have problem on dynamic struct array in function.

Pls help me.

Thks in advance.


#include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <iomanip>
Last edited on
Please use [code][/code] tags.

What is the problem?
I change my code
1
2
3
4
5
6
7
8
9
10
11
//const int nsize = 24;
struct srecord {
string* sname;
int score;
};

..
void display(srecord* &hs, int size)
//-----------------------------------------------
{ 
cout << hs[i].sname << ": " << hs[i].score << "\n";


it works but I'd like limit name to 24 characters long.
I am confused about dynamic struct.
Topic archived. No new replies allowed.