Question: I'm trying to make a function that changes a char array from the main function, that's what I'm trying to do:

```
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

void change(char *a);

int main()
{
    char a[] = "hello";
    printf("\na = %s", a);
    change(a);
    printf("%\na = %s", a);
    getch();
}

void change(char *a)
{
    a = "goodbye";
}

```

Answer: 
The main problem is that you are sending a copy of the char pointer a by doing this:

```
void change(char *a)
{
    a = "goodbye";
}

```

if you want to change a value in another function you should do this:

```
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

void change(char **a);

int main()
{
    char *a = "hello";
    printf("\na = %s", a);
    change(&a);
    printf("%\na = %s", a);
    getch();
}

void change(char **a)
{
    *a = "goodbye";
}

```
I changed the function, now it works, this way:

```
void change(char *a)
{
    strcpy(a, "goodbye");
}

```