
[英]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 建议“将此变量的类型设为指向常量的指针”,但我无法更 ...