struct

    0熱度

    1回答

    我對C和編程一般都比較陌生,所以我不確定我的問題。每當我運行代碼並打開新的輸出文件時,結構數據僅爲零。這裏是我的代碼....我已經把文本文件的內容放在問題的底部。先謝謝你。 #include <stdio.h> #include <stdlib.h> typedef struct { int id; char description[40]; double mancost; dou

    0熱度

    1回答

    我正在使用cython與C++編譯器,並且出現奇怪的分段錯誤等。 我的問題可以總結與此代碼段: from libc.stdlib cimport malloc,free from libcpp.vector cimport vector from libcpp.string cimport string cdef struct vstruct: int a double

    -5熱度

    2回答


    0熱度

    1回答

    struct _StoryElement_ { char *title_of_chapter_; struct _StoryElement_ *path_a_; struct _StoryElement_ *path_b_; char *content_of_chapter_; }; typedef struct _StoryElement_ StoryElement; 因此,我創

    0熱度

    2回答

    我一直在調試這個函數很長一段時間了,無法用這段代碼包裹我的頭。 void make_points(DocSpec instance, Tree *myTree, Point *p){ int i, j, k, index = 0; for(i = 0; i < instance.numPt; i++) { p[i].x = instance.xCoordinates[i

    0熱度

    1回答

    在C中實現ADT時,我總是認爲struct的定義應該在.c文件中,以便它是私有的。並且typedef應放置在.h文件中,以便其他模塊可以使用ADT,但無法直接修改其屬性。 我最近遇到了一個問題,我不得不將結構移動到.h。我還找到了一個答案Error: In C, got the error "dereferencing pointer to incomplete type" in a struct

    1熱度

    1回答

    輸出應該像這樣打印出來,當船員挖掘整個空間值「s」時,它將變爲值「T」,並且如果可以幫助創建一個打印地圖結構的函數,而不是每次都使用for循環我們將不勝感激太!: Crew Dig Carry 1 3 1 2 2 5 3 4 1 4 1 3 你想在哪裏送船員1? 4s 1s 3s 1s 2s 3s 1s 5s 1s 您已刪除所有的沙子從這一節! 您想將船員2發送至哪裏? 4s 1s 1T 1s 2

    -1熱度

    2回答

    我想做一個'表'來存儲遊戲的統計數據或技能值。 我最初試圖使用帶結構的多維數組,但我希望能夠隨時添加數據行。我做了一些研究:link,發現載體可能是我需要的。 我現在試圖做一個向量的向量結構,無濟於事。我不擅長與誤差d: 這裏是我的代碼: #include <iostream> #include <vector> using namespace std; int main() {

    2熱度

    1回答

    如何忽略查詢中time字段的默認值? 因爲他們在0001-01-01 00:00:00 +0000 UTC設置,我無法找到合適的文檔 // User model type User struct { Mail string `json:"mail" bson:"mail,omitempty"` Password string `json:"password" bson:

    0熱度

    2回答

    我一直用這段代碼停留在同一個地方。最後決定在網上提問。任何幫助,將不勝感激。 我已經創建了一個結構體,我可以將數據添加到結構中,但仍不確定我是否遵循了正確的方法。當我嘗試從文本文件讀取數據時,主要問題在於。 我似乎得到一個錯誤說: 錯誤C2678:二進制「>>」:沒有運營商發現,這需要左手 數類型的「的std :: ifstream的」(或有沒有可接受的轉化率) 結構體: struct bankD