我写了一个小的控制台应用程序,我希望它在循环(一段时间)再次启动之前暂停一定的秒数.
我正在使用Windows操作系统.
我正在开发一个小函数来显示(char)数组中最常见的字符.这是我到目前为止所取得的成就,但我认为我走错了路.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char test[10] = "ciaociaoci";
max_caratt(test, 10);
}
int max_caratt(char input[], int size)
{
int i;
char max[300];
max[0] = input[0];
for (i=0; i<size; i++)
{
if(strncmp(input,input[i],1) == 1)
{
printf("occourrence found");
max[i] = input[i];
}
}
}
Run Code Online (Sandbox Code Playgroud)
有帮助吗?