我正在学习C语言的指针.我已经编写了一个简单的指针代码.我没有错误,但程序iz在执行过程中冻结.可能是什么原因?
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
void main()
{
int i;
int *i2;
i2 = &i;
int z;
int *z2;
z2 = &z;
int b = 0;
int *b2;
b2 = &b;
char ch[250];
//char *ch2;
//ch2 = &ch;
printf("%s\n", " Enter line not longer than 250 characters");
gets_s(ch);
for (*i2 = 0; *i2<10; i2++)
{
if (*i2>4)
{
*z2 = *i2;
*b2++;
break;
}
}
printf("%d%c", *b2, ch[*z2]);
}
Run Code Online (Sandbox Code Playgroud) c ×1