我在cs50沙箱中混合了两个程序,一个是查找数组中的字符数,另一个是打印这些字符。我知道该程序是垃圾,但谁能解释一下编译器在这里做什么?当我运行它时,输出开始打印字母数字文本并且永远不会停止谢谢
#include <cs50.h>
#include <stdio.h>
#include <string.h>
int main(void)
{
string s = get_string("Name: ");
int n = 0;
while (strlen(s) != '\0')
{
n++;
printf("%c", n);
}
}