#include <iostream>
using namespace std;
class amin
{
private:
const int length = 10;
int newArray[length];
int i;
public:
int deleteEvenNumber(int getArray[length])
{
for (i = 0 ; i < length ; i++)
{
if (getArray[i] % 2 == 0)
newArray[i] = getArray[i];
i++;
};
return newArray[length];
};
};
main:
int main()
{
amin manipulateArrays;
int input , i = 0;
const int length = 10;
int mainArray[length];
cout<<"Please enter ten numbers :"<<endl;
for (i = 0 ; i < length ; i++)
{
cin>>input;
mainArray[i] = input;
i++;
};
manipulateArrays.deleteEvenNumber(mainArray[length]);
};
i got these two errors:
error C2664: 'amin::deleteEvenNumber' : cannot convert parameter 1 from 'int' to 'int []'
IntelliSense: argument of type "int" is incompatible with parameter of type "int *"
please help and explain about my mistake to me.
and please introduce a good tutorial for this problem or this title to me.
std::vectorrather than arrays. - Nick