#ifndef LISTTEST_H
#define LISTTEST_H
#include <vector>
#include <string>
template <class T>
class ListTest {
public:
vector<T>* encrypt(vector<T> *list, int* key);
void setkeyLength(int keyLength);
int getKeyLength();
private:
int keyLength;
};
#endif /* LISTTEST_H */
I have included vector and string header files in my own header file, but in “vector* encrypt(vector list, int key);” the compiler is giving error that vector is undefined
what am I am doing wrong here
You need to qualify the
vectorusingstd::vector, as it’s part of thestdnamespace. You should also consider removing<string>, as you don’t use it in the header.