[Dev-C++] Help me in deciphering complier error...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel A. <bt...@ca...> - 2002-04-05 01:47:57
|
Hello coders,
I have run into a problem with a program I am writing. I have a parent
class, DynArray, that StatArray is derived from. dynarray.cpp is in one
file, statarray.cpp is in another. My main program has an #include
"statarray.cpp" statement, and statarray.cpp in turn #include's
"dynarray.cpp". When attempting to compile the program, I get the following
errors. I am guessing this type of error indicates that I might be mixing
types, but I can't figure out where and what I need to correct. Any help is
appreciated. Thanks!
Danny
main.cpp: In function `int main()':
main.cpp:38: conversion from `StatArray (*)()' to non-scalar type
`StatArray' requested
main.cpp:14: in passing argument 1 of `GetArray(StatArray &, ifstream &)'
main.cpp:40: conversion from `StatArray (*)()' to non-scalar type
`StatArray' requested
main.cpp:15: in passing argument 1 of `PrintArray(const StatArray &,
ofstream &)'
/* code fragment here: */
14 void GetArray(StatArray&, ifstream&);
15 void PrintArray(const StatArray&, ofstream&);
...
36 StatArray myArray(); /* constructor */
38 GetArray(myArray, inData);
40 PrintArray(myArray, outData);
/* func definitions empty */
void GetArray(StatArray& targetArray, ifstream& inData)
{}
void PrintArray(const StatArray& sourceArray, ofstream& outData)
{ }
|