Quick c++ question

  • Thread starter Thread starter Deleted member 61728
  • Start date Start date

Deleted member 61728

Deleted member 61728

Hi need a quick helpful solution to this thanks problem is in comments.

Code:
#include <iostream>
using namespace std;
void func(char *p)
{
char arr[3] = {'a','b','c'}; 

*p = arr[0];
*p = *arr;//still value pointed by pointer is a  

}

int main()
{
char ar[3] ={};
func(ar);
cout<<ar;//how do i make this out put the complete contents of arr instead of just a
cin.get();
return 0;
}
 
Last edited by a moderator:
Thanks, knew it was something like that just forgot about a double pointer .
 
Back
Top Bottom