Calling a function with an array inside it

Hey, my question is simple. How do I call a function if I want to bring my array from my previous function? I tried this below, but it doesn't work, I get the error "argument of type 'char' is incompatible with parameter of type 'char *'".

I appreciate any answers, thanks a lot! :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  #include <iostream>

using namespace std;

void func(int valueC, char anArray[]);

int main()
{
	const int valueA = 20, valueB = 20;
	const int valueC = valueA * valueB;

	char anArray[valueC];

	func(valueC, anArray[valueC]);
}

void func(int valueC, char anArray[])
{
	//code
}
func(valueC, anArray);
Lets say I had give the array different values before calling the function. Would I be able to use it like this, without giving it new values?

 
  cout << anArray[32];

Topic archived. No new replies allowed.