1. ## reading from a file and classes

well im stuck again and its because of classes again. i have the follwing program that works fine but i need to make a class and use the code as a function of that class
Code:
```#include	<iostream.h>
#include	<fstream.h>
#include	<stdlib.h>

display a file on the screen
int	main(void)
{
const int	FileNameLen = 30;	// Constant int
ifstream	infile;			// file object
char		filename[FileNameLen];	// Store the filename
// as a character string
char		inchar;		//Read a character at a time

// Get the file name
cout << "Enter file name ->" << '\t' ;
cin >> filename;
// Open the file
infile.open(filename);

if (!infile)	{
cerr << "Cannot open " << filename << endl;
exit(1);
}

while (!infile.eof())	{
inchar = infile.get();
cout << inchar;	//display it on screen
}
infile.close();	//Close the file
return(0);
}```
this is what i have so far but it gives me a few errors, and im totally lost, someone help me out?
Code:
```#include	<iostream.h>
#include	<fstream.h>
#include	<stdlib.h>

const int	FileNameLen = 30, ArrayLen =4;	// Constant integer

class array
{
public:
array();
private:

ifstream	infile;			// file object
char		filename[FileNameLen];

char		inchar;		//Read a character at a time
};
array::array()
{

}
// display the file
{

// Get the file name
cout << "Enter file name ->" << '\t' ;
cin >> filename;
// Open the file
infile.open(filename);
// If you can't open the file, print error message
if (!infile)	{
cerr << "Cannot open " << filename << endl;
exit(1);
}

while (!infile.eof())	{

cout << inchar;//Display it on screen
}
infile.close();	//Close the file
return(0);
}
int main()
{
array Numbers;

cout <<"The numbers in the array "<< nums << endl;

return 0;
}```

2. i have narrowed it down a bit more, any suggestions pelease, this is what i got so far
Code:
```#include    <iostream.h>
#include    <fstream.h>
#include    <stdlib.h>

const int    FILENAMELEN = 30, ArrayLen = 4;

// The class array
class    array    {
public: // These functions are avaiable for use outside the class
inline int    getsize()    {return(size);}
array();

private:
//Private - available only to member functions
int    x[ArrayLen];
int    size;
};

//initialization constructor
array::array(void)
{
size = 0;
}

{
ifstream infile;
char filename[FILENAMELEN];
char inchar;

cout<<"Enter filename->" <<'\t';
cin>> filename;
//openfile
infile.openfile(filename);
//if you cant open the file, print error message
if (!infile)
{
cerr<< "Cannot open " <<filename << endl;
exit(1);
}

while (!infile.eof())
{
inchar = infile.get(); //this reads in even whitespaces
cout << inchar; //display it on screen
}
infile.close();
return(0);
}

int    main()
{
array    myarray;

return(0);
}```
but im getting 1 error where i have commented

3. Code:
```void array::readarray(void);
{```
See it?

4. If i remove the semicolon i get 5 errors instead of 1 that i was getting before. This is really getting on my nerves, im stuck on this the whole day. I cant even think anymore. Jesus help me lol

edit: since you know more than i do i took your advice and removed the semicolon, i got 5 errors instead of 1 so i tryed to figure them out. Turns out i have typed FILENAMELEN using camel notation on the declaration and captial letters when i was using it. yet i still get 1 error
Code:
```openfile' : is not a member of 'ifstream'
c:\program files\microsoft visual studio\vc98\include\fstream.h(98) : see declaration of 'ifstream'```
edit: i have corrected the code, and im still getting the above error

```#include    <iostream>