I'm trying to copy a char array into another char array using pointer arithmetic. It seems to be correct within the copy() but then I don't understand what happens after it gets to main. char a[] does not get the value of char b[] even if I called the function. Am I missing something? Hehehe
#include <stdio.h>
void copy(char a[], char b[]){
int *apoint = &a;
printf("%d\n", apoint);
printf("%d\n", &a);
*apoint = b;
printf("%d\n", *apoint);
printf("%s\n", a);
printf("%s\n", b);
}
int main(void){
char a[100];
char b[] = "bluhbluh";
copy(a,b);
printf("%d\n", a);
}