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},