各文字を変数に出力しようとしています。
これに変更することで ANSI char 番号を出力できますがprintf("Value: %d\n", d[i]);
、文字列の文字自体を実際に出力できません。
ここで何が間違っていますか?
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int len = strlen(argv[1]);
char *d = malloc (strlen(argv[1])+1);
strcpy(d,argv[1]);
int i;
for(i=0;i<len;i++){
printf("Value: %s\n", (char)d[i]);
}
return 0;
}