chương trình này bị lỗi gì vậy?
HTML Code:
#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> int main() { printf("nhap vao mot so:\t"); char *aa; aa=(char *)malloc(100); if(aa==NULL) { printf("error\n"); getch();exit(1); } else { aa="hello!"; char *ac; ac="welcome!"; printf("str1:%s\nstr2:%s",aa,ac); strcpy(aa,ac); printf("%s\n",aa); getch(); return 0; } }
Comment