AD> typedef struct mas_strok
AD> {
AD> char name[13];
AD> } STR;
AD> STR MAS_STROK[100];
AD> : "Cannot convert 'char *' to 'mas_strok'
I don't know what happened to the rest of the message, but
this got through.
Your actual array is inside the structure.
typedef struct
{ char name[13]; } STR;
STR *MAS_STROK = new STR[100];
Trying to create an array of 100*13 on the stack may be
unwise. It is better to allocate.
You might also prefer to use a class in this case.
class Name
{
public:
Name();
~Name();
void operator =(char*);
const char *GetName(void);
private:
char *pszName;
}
Name::Name(void) { Name = new char[13]; }
Name::~Name(void) { delete []Name; }
const char *Name::GetName(void) { return const pszName; }
void Name::operator=(char *N) { sprintf(pszName, "%.12s", N); }
Now you can simply create an array of classes, and have the
use of the = operator for your strings.
Name *MAS_STROK = new Name[100];
MAS_STROK[0] = "Kurt";
cout GetName() << endl;
this should prevent you having massive strokes while
attempting to use structures as quoted above. :)
> ] I don't know if I'm lighting candles or dancing.............
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)
|