I wrote a c++ function what takes in an array and prints some stuff with no output, yet when I try and call it I get the error:
main.cpp:11:2: error: no matching function for call to 'render'
render(board);
^~~~~~
./functions.hpp:1:6: note: candidate function not viable: requires 0 arguments, but 1 was
provided
void render();
Here is my code:
I have a page for my functions (functions.hpp):
#include <iostream>
using namespace std;
void render(int board[]){
cout << board[0] << "\n";
}
Then my main file:
#include <iostream>
#include "functions.hpp"
using namespace std;
int main() {
string board[] = {"_", "_", "_", "_", "_", "_", " ", " ", " "};
render(board); // This is where I am hitting the error
}
Can someone point out the error, I am very new to c++.