I want to make my own library and I have some problems with template function's.
main.cpp
#include <iostream>
#include "SMKLibrary.h"
int main() {
char a[5] = {"ASFD"};
array_print(a,5);
return 0;
}
SMKLibrary.h
#ifndef SMKLIBRARY_H
#define SMKLIBRARY_H
#include <iostream>
template <typename T>
void array_print(const T * array[], int size);
#endif
SMKLibrary.cpp
#include "SMKLibrary.h"
template <typename T>
void array_print(const T * array[], int size) {
int last = size - 1;
for (int i = 0; i < last; i++) {
std::cout << array[i] << " ";
}
std::cout << array[last] << std::endl;
}
Can someone explain to me why I have this error?