问题标签 [specifier]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
7221 浏览

java - 线程“主”java.util.MissingFormatArgumentException 中的异常:格式说明符“.2f”?

你能告诉我问题出在哪里吗?我在这里没有使用连接,错误仍然存​​在。

这是StackTrace

这是我正在谈论的代码:

0 投票
3 回答
483 浏览

c - C what is a function specifier? like _inline _NORETURN

Today I started learning OpenCL when I came across function specifier like _kernel. Than I searched for it and I found many function specifier like _inline _noreturn. I want to know what is a function specifier and what's its usage? I have read many C programming books but never found such term?

Is the above specifier similar to void?

0 投票
1 回答
482 浏览

java - Open android intent using a specific application(package name known)

My problem is that I have an intent such as this one.

And what happens is when I test the app it asks an open with. So if I open the standard music android app it doesn't open but when I use Google music it works like a charm.

So if there is no choice and I must use Google music as no could one answered this question I am guessing it is some problem I don't know. But atleast is there a way to set it such that it opens only via Google music app. Like setting googlw music as the default application to open the particular intent sent only by my application without harming any other process.

I am a beginner in Android. And pls. pls. Do help me.

0 投票
4 回答
865 浏览

c - %di 说明符在 C 编程中的作用是什么?

printf 函数中的 %d 说明符意味着我们要将变量显示为十进制整数,而 %f 说明符将其显示为浮点数等等。但是 %di 说明符有什么作用?

我在这个程序中找到了这个说明符(C 程序加减乘除复数,复数算术)

例如,

0 投票
1 回答
189 浏览

c - printf 为 %d 说明符打印字符而不是数字

在 xcode c 项目上,代码:

打印 't' ,而不是 5,尽管我明确包含了 %specifier,但根据规范应该打印带符号的十进制整数。我希望 '%c' 说明符会打印出来。到底是怎么回事?

在此处输入图像描述

0 投票
4 回答
1415 浏览

c - 我将如何在 C 中编写自己的新格式说明符?

是否可以在 C 中编写新的格式说明符?例如,假设 %g 是一个格式说明符,它从等价的无符号整数中以 ABCD 格式打印 IP 地址。

输出:以 ABCD 格式打印 IP 地址

0 投票
0 回答
155 浏览

c++ - 尽管命名空间正确,但缺少类型说明符

我收到一个错误,我通常会看到如果我忘记添加std::到像string. 在这种情况下,它是我自己namespace调用的x。具体错误如下:

Error 59 error C2143: syntax error : missing ';' before '*' e:\cppworkspace\xengine\xengine\code\include\x\graphics\graphics.h 32 1 XEngine

Error 60 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\cppworkspace\xengine\xengine\code\include\x\graphics\graphics.h 32 1 XEngine

图形头文件:

D3DWrapper 头文件:

我似乎无法弄清楚我的代码可能有什么问题来得到这个错误,所以任何帮助表示赞赏。

0 投票
2 回答
218 浏览

c - 复杂格式说明符 C

有人可以解释一下下面代码中的说明符之王是什么吗?并举个例子。

printf("\r\x1b[32mConverting: \x1b[36m%d\x1b[0m",(Convert));

0 投票
1 回答
608 浏览

c++ - 另一个头文件中的 C++ Struct 函数给出“缺少类型说明符”

我在“main.cpp”中输入了以下代码:

我有一个名为“rational.h”的头文件:

我在网上遇到错误:

它给了我以下错误代码:Fehler C4430 Fehlender Typspezifizierer - int wird angenommen。Hinweis:“默认整数”wird von C++ nicht unterstützt。翻译:错误 C4430 缺少类型说明符 - 接受 int。C++ 不支持“default-int”。

我认为是因为该函数没有正确检测到我的结构。谁能帮帮我?

问候,耐克

0 投票
3 回答
396 浏览

c - 在 printf %g 格式说明符中将 0 视为有效数字

我正在尝试使用 printf 以仅打印前 n 个字符的方式打印浮点数 1.2345678、0.1234567、123.45678。我想让这些号码排成一行。printf("%*g", n, var) 中的 %g 格式说明符会执行此操作,但说明符不会将 0.1234567 中的 0 视为有效数字。这会导致 0.1234567 的对齐方式偏离其他两个数字。

以给定格式对齐数字的最佳方法是什么。通过使用 %g 或使用其他方法将 0 视为显着?