PDA

Click to See Complete Forum and Search --> : I hate classes!


wossname
Jul 4th, 2001, 01:18 PM
typedef unsigned long integer ULI;

class SecureHA
{
private:

ULI H[5]={23,54,27,45,64}; //ERROR HERE!
...
...
...
}:


The compiler will not let me initialise this array within the class definition, any ideas why?

Yonatan
Jul 4th, 2001, 01:51 PM
You cannot initialize data members like this. It must be in the constructor.

class c
{
private:
int h[5];

public:
c()
{
h[0] = 23;
h[1] = 54;
h[2] = 27;
h[3] = 45;
h[4] = 64;
}
};

Enjoy :rolleyes:

wossname
Jul 11th, 2001, 01:18 PM
Cool thanks.

Hmm, I don't suppose you know how to read a file into an array of unsigned long integers do you?
The array size is a multiple of 512 bytes. But the file is probably a bit less than that (but the array will always be big enough to hold the file).
Its a weird request from a C++ newbiw like me, but I gotta start somewhere!

:)

denniswrenn
Jul 11th, 2001, 01:45 PM
How are you going to store the information in the unsigned long integers? Is it going to be the ASCII value?

wossname
Jul 12th, 2001, 02:58 AM
Once its in the array and has been processed, it will be in a completely incoherent form. Except no-one knows how to get it in there!