小编Ldx*_*Ldx的帖子

等待/暂停C中的秒数

我写了一个小的控制台应用程序,我希望它在循环(一段时间)再次启动之前暂停一定的秒数.

我正在使用Windows操作系统.

c windows

9
推荐指数
1
解决办法
3万
查看次数

C - 查找char数组中最常见的元素

我正在开发一个小函数来显示(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)

有帮助吗?

c arrays

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

c ×2

arrays ×1

windows ×1