我有以下代码
#include <stdio.h>
#include<conio.h>
#include <ctype.h>
char *convertire(char *sir)
{
char *sir2="";
while (*sir)
{
*sir2 = toupper(*sir);
sir++;
}
return (sir2);
}
void main(void)
{
char *sir = "Home is good";
char *sir2 = convertire(sir);
printf("Sirul obtinut este : %s\n", sir2);
_getch();
}
当我尝试编译时出现以下错误
First-chance exception at 0x00E3141B in pointeri.exe: 0xC0000005: Access violation writing location 0x00E35858. If there is a handler for this exception, the program may be safely continued.
你能帮我解决这个问题吗?