C语言报错
run-time check failure #2 - stack around the variable 'H' was corrupted.
#include <stdio.h>
#include <stdlib.h>
void main() {
char H = 'A';
int* p = &H;
*p = 'B';
printf("H的值为:%c\n", H);
printf("p存储的地址为:%p\n", p);
printf("p的地址为:%p\n", &p);
H = 'C';
printf("H='C';的值为:%c\n", H);
printf("通过地址获取的为:%c\n", *p);
system("pause");
}
运行一切正常,在systeam("pause");执行完成后,Main函数结束大括号报错:run-time check failure #2 - stack around the variable 'H' was corrupted.
我看了半天也没找到问题,局部变量什么的都看了,H在运行全过程的值都是正常的char类型
请求帮助