Questions tagged [specifier]
59 questions
0
votes
3 answers
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…

RajSharma
- 1,941
- 3
- 21
- 34
0
votes
1 answer
Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '.2f'?
Can you please tell me where is the problem? I am not using concatenation here and the error is still there.
Here is the StackTrace:
`adding $Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '.2f'
at…

RahulS
- 13
- 1
- 4
0
votes
1 answer
Byte order (endian) of int in NSLog?
NSLog function accepts printf format specifiers.
My question is about %x specifier.
Does this print hex codes as sequence on memory? Or does it have it's own printing sequence style?
unsigned int a = 0x000000FF;
NSLog(@"%x", a);
Results of above…

eonil
- 83,476
- 81
- 317
- 516
0
votes
0 answers
C format length specifier not working correctly
This is strange.
Code:
for(i=ncx-1;i>=0;i--)
{
fprintf(stderr,"|%-21s|\n",clist[i].label);
}
fprintf(stderr,"0-2-4-6-8-0-2-4-6-8-0-2-4\n");
Output:
|5g(²G) |
|5f(²F°) |
|5d(²D) |
|5s(²S) …

Mannix
- 411
- 10
- 23
0
votes
2 answers
C++ error : Expected an identifier
i am trying to make an header but it gives me error :
#ifndef __OFFSETS__H_
#define __OFFSETS__H_
typedef unsigned long MAIN = 0x22EA120;//0x022BF0C0 ;
typedef unsigned long RECOILVT = 0x020A3ACC;//0x020FA644;
typedef unsigned long DEVIATIONVT =…

user2594386
- 1
- 1
- 2
-1
votes
1 answer
What does %s(%s) specifier do?
I have a function that writes a sql query
I can't figure out what does the expression %s(%s) do in this function
public void createTable(String tabName) throws SQLException {
String sql = "create table if not exists %s(%s)";
sql =…

Nikita28
- 1
- 2
-1
votes
2 answers
Why do I recieve the value of a different variable when I mismatch the format specifier?
When I run this code the output of D comes out as the value of C. Is it because I call for a float and it just takes the most recent float in the memory?
#include
int main()
{
int a=3/2;
printf("The value of 3/2 is : %d\n", a…

Liro
- 7
- 3
-1
votes
1 answer
printf prints character instead of digit for %d specifier
On xcode c project, the code:
#include
int main()
{
int* pi = (int*) malloc(sizeof(int));
*pi = 5;
printf("*pi: %d\n", *pi);
free(pi);
return 0;
}
prints 't' , instead of 5, although I explicitly included the…

Draif Kroneg
- 743
- 13
- 34
-1
votes
1 answer
Format Specifier of byte in Java
What's the format specifier of byte in Java?
For example,
%d=int
%s=short
%f=float

Furkan Aktaş
- 83
- 6
-1
votes
1 answer
Objective-C Incorrect Format Specifiers
I am trying to learn Objective-C and the book i am learning from presents some code for me to type into Xcode. I keep receiving warnings on the scanf function for incorrect format specifiers even though this is how it is typed in the book. The code…

rishaan
- 1
- 2
-2
votes
1 answer
C++ Multiple Classes in ONE cpp file
I'm required to work with multiple classes in one .cpp file. I'm not sure what I'm doing wrong, is there a header file I need to include?
These are the errors I'm getting:
error C3646: 'loginObject': unknown override specifier
error C4430: missing…

smirand
- 25
- 4
-2
votes
4 answers
What does %di specifier do in C programming?
%d specifier inside the printf function means that we're going to display the variable as a decimal integer and %f specifier would display it as a float number and so on.
But what does %di specifier does ?
I found this specifier in this program(C…

makkBit
- 373
- 2
- 14
-3
votes
1 answer
why %p,%x gives address in alphabet values and why %p gives any value in so many zeros(x86); also why the %d and %u specifiers do not work like them
can anybody explain briefly how exactly these specifiers are working..i searched a lot about them but still confused about them.(i have a 32 bit pc).
#include
int main()
{
int v,*p;
v=3;
*p=v;
printf("the value of v = %d…

Pranshu taneja
- 9
- 1
-3
votes
1 answer
Why is the output of the code snippet printf("%. %. %. "); comes to be %.0 %.0 %.0?
I know that period . symbol separates field width with precision. But, I am not getting how the zero is coming after %. Every time I am running it is showing the same output.
The code:
#include
int main() { printf("%. %. %. "); return…

Rohit Pratap
- 13
- 4