D
Daqian Yang
here is the code:
---
#ifndef XFILE_A2_H
#define XFILE_A2_H
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
namespace xf{
class Xfile{
public:
void compress();// throw (runtime_error);
void stats();// throw (runtime_error);
private:
Xfile(string = "mydata", int = 10, int = 10); //constructor
typedef char* Xstr;
Xstr* storage_; //an array of array to store the data
int size_; //lines array contains
int length_; //length for each line
}
}
#endif
----
GCC gives me this error:
xfile_a2.h:23: error: parse error before `}' token
xfile_a2.h: In function `int xf::main()':
xfile_a2.h:17: error: `xf::Xfile::Xfile(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, int, int)' is private
anyone knows why(maybe a newbie question)? Thanks.
---
#ifndef XFILE_A2_H
#define XFILE_A2_H
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
namespace xf{
class Xfile{
public:
void compress();// throw (runtime_error);
void stats();// throw (runtime_error);
private:
Xfile(string = "mydata", int = 10, int = 10); //constructor
typedef char* Xstr;
Xstr* storage_; //an array of array to store the data
int size_; //lines array contains
int length_; //length for each line
}
}
#endif
----
GCC gives me this error:
xfile_a2.h:23: error: parse error before `}' token
xfile_a2.h: In function `int xf::main()':
xfile_a2.h:17: error: `xf::Xfile::Xfile(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, int, int)' is private
anyone knows why(maybe a newbie question)? Thanks.