#include<stdio.h>
#include<malloc.h>
void my_strcpy(char *sour,char *dest){
if(sour == NULL || dest == NULL){
return;
}
dest = sour;
}
int main(){
char *d = NULL;
char *s = "Angus Declan R";
//d = malloc(sizeof(strlen(s)+1));
//my_strcpy(s,d);
d = s;
printf("\n %s \n",d);
return 0;
}
これでは、「s」が指している場所を指すようにポインタ「d」を作成しようとしています。その場所を指していないのはなぜですか。