fread

    1熱度

    2回答

    基本上,我試圖學習如何手動打開圖像而無需使用LIBRARIES並查看RGB內容。 我想這樣做,所以我可以計算出RGB的色調和飽和度以寫回二維數組圖像。 到目前爲止,我得到這個: #include <iostream> #include <stdio.h> /* printf */ #include <math.h> /* acos */ #include <fstream> /* fo

    0熱度

    1回答

    我寫過Zsh模塊。在那裏我有一個內置函數映射到Zsh命令。這個函數可以複製其標準輸入文件描述符: /* Duplicate standard input */ oconf->stream = fdopen(dup(fileno(stdin)), "r"); 然後,線程派生,其獲得oconf結構。在該線程,我做的: errno = 0; /* Read e.g. 5 characters,

    -3熱度

    2回答

    我知道fread並不意味着與非二進制文件一起使用。然而,我想知道:如果我提供了正確的輸入大小的函數,爲什麼不應該返回正確的值,而是它會返回垃圾? FILE *fp; int val = 0; if(fp = fopen("test.txt", "r")){ fread(&val, sizeof(int), 1, fp); printf("val read %d \n",

    1熱度

    1回答

    我想用fread和fwrite讀取和寫入與文件中的結構有關的數據。這裏是我的代碼: #include<stdio.h> #include<time.h> #include<stdlib.h> #include<string.h> typedef struct book book; struct book { char title[200]; char auth[200]; c

    1熱度

    1回答

    我們試圖在php中讀取我們的網站作爲文件,而fread函數只能讀取255個字符,任何人都可以幫助我們解決這個問題? 代碼: $filename = "oururl"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); 此外,當我們試圖通過閱讀

    0熱度

    1回答

    我發送iOS通知,並在作出響應從蘋果服務器檢查是否有一些錯誤使用fread()但代碼卡住了一些循環或只是加載和加載。無法弄清楚原因。 $apnsHost = 'gateway.sandbox.push.apple.com'; $apnsCert = 'j_.pem'; $apnsPort = 2195; $apnsPass = ''; $notification = "hey"; $s

    1熱度

    1回答

    基本上我的問題是,當我使用下列程序: #include <stdlib.h> #include <stdio.h> #define SIZE 1000 int main() { FILE *fp; int r, i; char fp_string[600] = "/Users/mac/Library/Mobile Documents/com~apple~CloudDocs/Col

    1熱度

    1回答

    我是新來學習C語言的人,我想編寫一個簡單的程序,用於從一個.csv文件複製數組整數文件複製到一個新的.csv文件。我的代碼按預期工作,但是當fread/fwrite的數組大小設置爲.csv數組中元素的精確數量(在本例中爲10)時,它只複製9個元素。 當數組大小設置爲+1時,它將複製所有元素。 #include <stdio.h> #include <stdlib.h> #define LIS

    0熱度

    1回答

    FREAD字符我有一個​​虛擬的計劃,在一個文件中寫入一些字符: int main (int argc, char **argv) { char i = '0'; int j = 0; FILE * fp = NULL; fp = fopen("num.txt","w+"); if(!fp){ printf("fopen faile

    1熱度

    1回答

    我編寫了一個名爲「的download.php」到文件推送到客戶端PHP腳本, $fd = fopen($path, "rb"); if ($fd === false) { echo "404 file not found"; return false; } Header("Content-type: image/png"); while (!feof($fd))