c

    -1热度

    1回答

    我想用C编写程序,它将以root用户身份打开bash,但对于任何用户都没有密码。 #include <unistd.h> #include <stdio.h> int main(void) { char *argv[] = { "/bin/bash","-c","sudo /bin/bash",0 }; execve(argv[0], &argv[0],0);

    1热度

    1回答

    为什么下面的代码给出的答案是-2.000000的每个输入? #include <stdio.h> #include <math.h> int main() { long long int s1,s2; long double l,y,m=sqrt(2); scanf("%Lf %lld %lld",&l,&s1,&s2); y=l*m;

    0热度

    1回答

    // Sting for the Name extern const PROGMEM char name[]; //Data structure of the Heap typedef struct { AllocStrategies strategy; uint16_t size; MemAddr start; MemDriver* drive

    0热度

    1回答

    我做了一个Go程序来模拟按键。为此,我必须使用cgo和不同的C代码片段,具体取决于操作系统,正在编译Go代码。 我写的代码如下所示: package keyboard /* #include <stdint.h> #ifdef __WIN32 #cgo CFLAGS:-nostdlib #include <Windows.h> void SetKey(uint16_t key, u

    0热度

    2回答

    我在我的程序中执行一些物理计算,其中输出需要存储到临时缓冲区并通过管道。 缓冲区需要共享不同的数据类型:首先,我需要存储我研究这一课题的名称;其次是我的计算结果(全部为float数字)。 的代码看起来是这样的: initialdata.dat Aston Martin Vantage V12|07.7|090 Ferrari LaFerrari |09.6|111 Lamborghini A

    -1热度

    1回答

    #include<stdio.h> void swap(int a[60],int p, int min){ int temp; if (min!=p){ temp= a[p]; a[p]=a[min]; a[min]=temp; } return; } void selection(int a[60]){

    -1热度

    3回答

    #include <stdio.h> #include <stdlib.h> #define TEN 10 int main() { int number = 0; int digit = 0; int last_digit = 0; int digit_sum = 0; int i = 0; while (i == 0) { printf("Please Enter A

    1热度

    1回答

    看起来这可能是O'Reilly出版的Head First C,2012,Griffiths and Griffiths中的一个错字。在p。 165,有一个练习: “有一个新的计划帮助头等第一餐馆的服务员巴士桌子,代码会自动汇总一张账单,并为每件物品增加销售税,看看你是否能找出需要去的东西在每个空白处“ 该错误似乎在第7行,float add_with_tax(float f);。定义函数时,分号不

    -1热度

    1回答

    我遇到了一个错误,而调试我的程序,甚至阅读汇编代码 下面是从GDB的图像后,我解决不了,0x4070a1之前,%RDX是0x61b130,并且这个数字应该移到-0x18(%rbp)。但是,在这个指令之后,我发现-0x18(%rbp)变成了0x61b7d0,这让我感到困惑。 由于这个问题,我的程序无法正常运行,谁能告诉我原因?谢谢! 的C代码: E_enventry t = E_FunEntry(l

    0热度

    1回答

    我正在用c中的2d数组操作进行实验。就地尤其是2D图形的旋转,让我做我的研究,并提出了: #include <stdio.h> #include <stdlib.h> #include <math.h> #define RAD(x) ((x) * 3.14/180) char shape[3][3] = {{1, 1, 1}, {1, 0, 1},