![](/img/trans.png)
[英]What is the difference between a declarator and a direct-declarator?
在作者 Brian W. Kernighan 和 Dennis M. Ritchie的 C Programming Language, 2nd Edition 中,他們討論了聲明符和直接聲明符。 討論從本書第 1 頁開始。 122 with dcl and direct-dcl 's 請用通俗易 ...
[英]What is the difference between a declarator and a direct-declarator?
在作者 Brian W. Kernighan 和 Dennis M. Ritchie的 C Programming Language, 2nd Edition 中,他們討論了聲明符和直接聲明符。 討論從本書第 1 頁開始。 122 with dcl and direct-dcl 's 請用通俗易 ...
[英]warning: initialization makes integer from pointer without a cast and the output only shows else part even if I enter correct user and password
該程序要求輸入用戶名和密碼,然后檢查輸入是否正確並打印合適的語句。 但是,對我來說,即使輸入的數據正確,它也只顯示其他部分。 在此處輸入圖像描述 ...
[英]extern variable prototype: comparison of array not equal to a null pointer is always true
在清理舊程序時 GCC 返回了一個我無法理解的警告。 這是一個片段:#include <stdio.h> #include <stdint.h> extern int *foo[]; int main(void) { if (foo != NULL) ...
[英]PHP initialize multimensional arrays before increment
我必須在舊的 php 項目中執行大代碼修復。 問題如下:我有一個數字語句,其中代碼嘗試將整數添加到未初始化的多維 arrays,如下所示: 但是$array_test是這樣聲明的: 這種情況在項目中給了我很多警告,因為這種代碼模式發生了 16k 次。 有什么辦法可以解決這個問題,比如添加這樣的語句 ...
[英]Delphi procedure: First instruction doesn't compile
我正在編寫一個 Delphi 應用程序,其中我有一個程序來清除表單並將其重置為默認值 state。 我已經嘗試了一切——程序中的第一行代碼無論如何都無法編譯。 我也看不出程序聲明有任何問題。 有人可以幫忙嗎? 我的謝謝。 我正在嘗試清除表單中的所有字段,啟用已禁用的內容等。將其重置為默認值 stat ...
[英]Why am I able to print the sizeof variables even though I have not initialised them in C?
我試圖了解當在 main function 中聲明時,一個變量在 C 中准確獲得 memory 的時間。我發現了一個類似的問題When does memory gets allocated for a variable in c? 這里。 它提到分配memory時沒有硬性規定。 但我正在嘗試具體了 ...
[英]How to define functions from declarations where the parameters do not have identifiers?
對於作業,我得到了一個 header 文件。 目標是在 C 文件中寫入 function 定義。 當其中一些函數沒有標識符名稱時,我對如何編寫函數定義感到困惑。 當原型沒有標識符名稱時,我不確定我應該如何定義這些函數。 例如,將參數設為const struct course* <Identi ...
[英]Why isn't my integer printing out properly in C
我只是想寫一些需要一個月和日期的東西,然后打印出來。 我寫了以下代碼: 當我輸入像 12 月 22 日這樣的日期時,我得到以下打印輸出:月份是 12 月,日期是 1。日期值打印為 1。為什么我的日期 integer 沒有更新,而是停留在 1? ...
[英]Is a number between the 2 square brackets necessary regarding char variables
我剛開始在 C 編程,我在 inte.net 上看到人們聲明char s,例如char name[] ,沒有在 2 個方括號之間放置任何數字。 我曾經在高中時用 C++ 編碼,我們總是在聲明 char 時放一個數字。 有人可以解釋我們什么時候放一個數字,或者在聲明char變量時是否有必要使用一個數字 ...
[英]can use " int a = {0} " in C programe to init a array?
我發現這段代碼,當我編譯它時,編譯器告訴我“下標值既不是數組也不是指針”。 我知道我的平台很舊。 但我想知道“unsigned int bValue = {0}”是初始化數組的新方法嗎? 我想知道“unsigned int bValue = {0}”是一種初始化數組的新方法嗎? ...
[英]I am unable to understand what is the statement struct node *a [26] used for.. after we make the structure of a node for linked list
我們是在制作節點指針數組還是為節點指針分配大小? 請幫助我解決這個問題。 ...
[英]Why does Ada Language use Semicolon `;` to Separate Parameters in Subprogram Declarations?
碼友們.. 我只是一個新手,並嘗試在他們特定的設計環境中練習一些編程范例。 最近在Ada Language Procedural Programming中學到了很多新的小東西,學習體驗非常好。 但是,對於為什么 Ada 使用分號,我無法自己找到答案; 分隔子程序聲明中的參數。 對於任何來自任何其他 ...
[英]If statement not judgind correctly
我現在在做數組,IF語句判斷錯誤。 我恢復了我的代碼: 問題是 MinX 大於 AM,它不會進入第一個 IF 語句(代碼 1),而是進入第二個。 我不知道我是否正確地對變量進行了貼標,還是別的什么。 如果 MinX < AM,它也會進入第二條語句(代碼 2)。 有人可以幫助我嗎? 我在這個問題 ...
[英]Assistance declaring RecyclerView.Adapter in Kotlin
Pre:第一次聲明我的 viewHolder 並且最近使用 Kotlin。 也許我有一個非常基本的錯誤,但我看不到它。 提前。 錯誤: “未解決的參考:ViewHolder” 在類聲明中指定我的 ViewHolder 時會發生如下情況: 我嘗試了幾種方法。 但是,錯誤發生在使用公共 Andro ...
[英]Generate variable type and initializer from macro
我想從(過程)宏生成一個變量類型和初始值設定項。 由於宏使用並生成令牌流(而不是樹),從道德上講,應該可以執行以下操作: 但是,唉,這失敗了 現在,我當然可以把它翻過來並要求寫一些像 這將擴展到 但我想分段做事的原因是能夠使用相同的宏在不同的上下文中生成類型和初始化器(例如,對於本地let綁定,而不 ...
[英]How to declare a class for a calculator?
我正在嘗試使用類聲明在 Haskell 中構建我自己的計算器。 首先,我試圖實現加法,但在這里我得到了錯誤: 無法將預期類型“Exp -> Double”與實際類型“Exp”匹配data Exp = Number Double | Add Exp Exp class Calc a wh ...
[英]Explanation of class instance declarations
我正在關注教程並找到了這段代碼:data A = B | C deriving(Eq) class K a where f :: a -> Bool instance K A where f x = x == C f _ = False call = f B 為什么我需要f _ ...
[英]Error using .reserve() to reserve space for a vector
我正在嘗試為 med_array 向量保留 memory,如下所示 但是,我收到一條錯誤消息:medianfinderheader.h:10:4: error: 'med_array' does not name a type 10 | med_array.reserve(50000); ...
[英]Can you return a struct that is declared inside that function?
我想返回聲明的結構,以及在initializePlayer() function 中設置的值,以便我可以在主 function 上調用它。 這是一項任務,我們不允許聲明全局變量(僅在函數內部)所以我有點認為我需要在函數內部聲明struct ——除非它不是變量(?)我真的不知道:( 這是我的代碼,我 ...
[英]Is it possible to define a var to be a pointer to const when the type is defined as a pointer to a struct?
假設test_t定義如下: 是否可以在不修改test_t定義的情況下將變量定義為指向 const 的指針? const test_t var將是指向struct test_t的 const 指針,對嗎? 我有這個問題,因為 sonarqube 建議“將此變量的類型設為指向常量的指針”,但我無法更 ...