c

    0热度

    1回答

    我需要在我的代码中使用一些定时器。我有这样的事情: struct sigevent ec; ec.sigev_notify = SIGEV_THREAD; ec.sigev_value.sival_ptr = &c_timer; ec.sigev_notify_function = c_thread; ec.sigev_notify_attributes

    -1热度

    3回答

    我有下面的代码,我试图计算所有进程。我不明白如何计算最大进程数。 #include <stdio.h> #include <stdlib.h> int main() { int pid, pidmax = 0; while(1) { pid = fork(); pidmax = getpid(); if(pid == 0){

    0热度

    1回答

    我正在学习gcc选项DDEBUG。 下面是我的测试简单的代码: #include <stdio.h> #include <stdlib.h> #ifdef DEBUG #define debug(msg) printf("Debug: %s\n", msg) #else #define debug(msg) #endif int main(int argc, c

    0热度

    1回答

    因此,我构建了一个简单的操作系统,并且在从引导扇区调用内核代码时遇到上述错误。我花了几天的时间挣扎,仍然处于死胡同。 代码在调用KERNEL_OFFSET时失败。我知道它的失败,因为我试图跳到一个无效的部分,但我不知道如何以及在哪里。 我也注意到它并不是真的读取磁盘。我的load_kernel代码要求读取10个扇区,但似乎只有读取。 该程序能够进入保护模式,并能够加载我需要从磁盘加载的内容,尽管加

    -5热度

    2回答

    #include <stdio.h> #define STR /*~~Complete this line~~*/ /* such that the output of the code is M = 10 N = 5 */ #define N 5 #define M 10 int main() { printf(STR(M)); printf("\n"); pri

    -6热度

    2回答

    我有这样的代码: #include <stdio.h> #include <time.h> int main(void) { time_t rawtime = time(NULL); struct tm *ptm = localtime(&rawtime); printf("The time is: %02d:%02d:%02d\n", ptm->tm_ho

    0热度

    1回答

    你能帮我将struct的元素传递到函数(void show_info_abt_bus)用于输出我的信息?我不明白我应该如何通过这些元素。 #include <stdio.h> #include <stdlib.h> #include <malloc.h> #include <string.h> typedef struct info_bus_{ int number;

    0热度

    1回答

    我已经阅读了关于这个主题的几篇文章,但有人说它应该完成的方式取决于你所在的体系结构和系统(Windows/Linux ),那么有没有一种合适的方式来独立完成这个平台?

    2热度

    2回答

    我有以下的链表实现: struct _node { char *string; struct _node *next; } struct _list { struct _node *head; struct _node *tail; } 我想作以下功能: void deleteList(struct _list *list, int from,

    0热度

    2回答

    所以我一直在做一些家庭作业的编码,我发现显示,排序,更新,甚至删除文件有一些问题。有很多代码,我发现,但没有一个工程,我什至不能找到删除文件的代码..你们可以帮我吗? #include<stdio.h> #include<stdlib.h> char id[20], year[20], title[20], name[20]; void write(char id[], char titl