问答
-
关于堆栈:简单的 C 代码错误
Simple C Code Error 有谁知道为什么我在运行这段代码时会出现段错误? Valgrind 告诉我,我在第 13 行 if( !isdigit(x) ) 上有"大小为 4 的未初始化值",并…… -
关于C#:为什么默认堆栈大小为0
why is default stack size 0 我正在阅读来自 https://computing.llnl.gov/tutorials/pthreads/ 的 pthreads,它说 Default thread stack size varies gre…… -
关于 c:我应该读/写多少字节到一个套接字?
How many bytes should I read/write to a socket? 我对在 Unix 上通过 C 中的套接字写入/读取的字节数有些疑问。我习惯发送 1024 字节,但有时当我发送短字…… -
关于 c:printf 格式字符串 lint 警告
printf format string lint warning 我一直在修复古老的代码,这是今天的问题: 12 output_file_status = fprintf ( data_file,"%03d%08s%+014.2f%0…… -
关于 c:pthread 返回例程
pthread returning routine 我的例程必须有一个返回值并且需要返回。 即: 1 int mySuperThread(void) 我启动线程,它会做它需要做的事情。…… -
关于C#:为什么scanf把字符串放到char数组中,直接输入不行?
Why does scanf put a string into a char array while directly inputting it does not work? 这个问题很难命名。 基本上我有一个具有自己结构的数组。 …… -
关于 c:pthread_join 返回一个 NULL 地址
pthread_join returns a NULL address 我是 C 线程编程的新手。我在下面尝试了一个简单的程序。 123456789101112131415161718192021 #include<s…… -
关于 c:Swapping 2 Bytes of Integer
Swapping 2 Bytes of Integer 我有一个接收 3 个参数的方法:int x、int n 和 int m。它返回一个 int,其中 x 的第 n 个和第 m 个字节已交换 x 只是一个普通…… -
关于 c :cuda 文件没有与 C 文件中定义的函数链接
cuda file did not link with function defined in C file 我有一个 cuda 文件 test.cu,其中包含一个文件 cuda.h。 cuda.h 包含 test.cu. 中使用的以下函…… -
关于 c:gcc 简单算术循环性能
gcc simple arithmetics loop performance 问题:明显多出一行代码会使程序加速近两倍。 这是一个很难表述的原始问题,它来自边界检查消除算法。所以,只是…… -
关于C#:创建一个整数数组并以空格结尾
Creating an Integer Array and terminating with a blank 我正在编写一个程序,该程序涉及一次请求用户输入一个随机数量的整数,该输入在用户返回空白后终…… -
关于 c:Macro 重定义警告
Macro Redefined Warning 我正在编写这段代码,当我尝试编译时出现警告。 12345678910111213141516171819202122232425262728293031323334353637383940…… -
关于 c:在这种情况下处理 pthread 通信/信号的正确方法?
Proper way to handle pthread communication / signals in this instance? 我正在编写一个在对等点之间共享文件的小型客户端/服务器演示。一个对等点从主服…… -
C中链表的错误遍历列表
Error Traverse List of LinkedList in C 我编写了以下代码,但是当我尝试编译代码时,编译器显示以下错误。我的错在哪里? 编译器错误: main.c:32:39: er…… -
如何在 C 中仅设置字节的某些位而不影响其余位?
How do you set only certain bits of a byte in C without affecting the rest? 假设我有一个像 1010XXXX 这样的字节,其中 X 值可以是任何值。我想将低四…… -
关于 c:gcc 编译器中是否有用于 pthread 代码的标志以最小化执行时间?
Is there are flag in gcc compiler for pthread code to minimize execution time? 我正在用 C 语言编写 pthread 代码,并使用 gcc 编译器。我已经用 pthre…… -
关于 c:GTK:在 scrolled_window 滚动后获取滚动事件上的指针位置
GTK: Get pointer position on scroll-event AFTER scrolled_window has scrolled 我在滚动窗口内有一个绘图区域(带有方便的视口), 这个绘图区域会根据传入…… -
关于指针:c:将 const char* 读入 sscanf 中的变量?
c: reading const char* into a variable in sscanf? 我正在尝试将字符串/*char 扫描到变量中并将其传递给函数,但我收到错误 "format specifies type 'char…… -
关于C#:你能静态编译一个cygwin应用程序吗?
Can you statically compile a cygwin application? cygwin 是否允许静态编译的二进制文件?这将防止 cygwin1.dll 出现在目标机器的 PATH 上。 不,目前无…… -
关于 c:Linux 中 printf(“ …”) 和 printf(“.. “) 的输出差异
Difference in Output between printf("n...") and printf("..n") in Linux 本问题已经有最佳答案,请猛点这里访问。 谁能解释一下为什么这两个相似的代…… -
关于 c :Cannot execute binary error on an Intel Xeon Phi
Cannot execute binary error on an Intel Xeon Phi 我有一个可以在我的机器上本地编译和运行的 C 代码。 但是,当我尝试使用 icc 和 -mmic 标志进行编译并…… -
关于 malloc:C – free() 对内存有什么作用?
C - What does free() do to the memory? 我重新编码了 malloc()free() 和 realloc()。 我有一个带有 malloc(). 返回的指针的链表 问题是:free() 究竟做了…… -
如何在C语言中使用√符号
How to use √ symbol in C 我想在下面写的程序中使用√符号。 12345678910 #include <stdio.h> main(){ char a='√'; if (a=='√'){ …… -
关于C#:如何输入包含\’\ \’的字符串
How to input of a string which contain 'n' in it 我创建了一个自动打字机器人,它模拟用户给出的字符串字符。 我的代码是这样的: 1234567891011121…… -
关于 c:向内存映射文件添加新字节
Adding new bytes to memory mapped file 如何向内存映射文件添加新信息? 使用指针我可以处理现有数据,但仅限于它们当前的大小。是这样吗 ?例如: 1……