here is the class i am trying to call from, followed by my call from main and then the error message that i am getting.. is there something i should do? i dont see it... ive never had to deal with enumerated types before in all my years of C++, never really needed to use it.. anyway i appreciate your time! thanks!
class
class NcFile
{
public:
virtual ~NcFile( void );
enum FileMode
{
ReadOnly, // file exists, open read-only
Write, // file exists, open for writing
Replace, // create new file, even if already exists
New // create new file, fail if already exists
};
NcFile( const char * path, FileMode = ReadOnly);// ,
// size_t *chunksizeptr = NULL, // optional tuning parameters
//size_t initialsize = 0 );
NcBool is_valid( void ) const; // opened OK in ctr, still valid
......
}
from main.cpp
//netcdf reader for use with the GDEM Software...
#include <iostream>
#include <sstream>
#include "netcdfcpp.h"
using namespace std;
int main()
{
NcFile *a = new NcFile("sspgdemv3s01.nc", NcFile::FileMode = ReadOnly);
return 0;
}
error(s):
--------------------Configuration: netcdf_test - Win32 Debug--------------------
Compiling...
main.cpp
C:\Program Files\Microsoft Visual Studio\VC98\MyProjects\netcdf_test\main.cpp(11) : error C2065: 'ReadOnly' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\VC98\MyProjects\netcdf_test\main.cpp(11) : error C2275: 'NcFile::FileMode' : illegal use of this type as an expression
Error executing cl.exe.
netcdf_test.exe - 2 error(s), 0 warning(s)