Questions tagged [specifier]

59 questions
1
vote
1 answer

Tkinter won't allow for me to use variables to define window size

I am currently trying to add a feature to my program where the programs resolution will change at every launched based on your screen resolution. I have run into an issue though. It first states that my variables, width and height are undefined. I…
Austin Hargis
  • 139
  • 1
  • 1
  • 12
1
vote
5 answers

Format specifier without argument

Consider the following code sample: #define STRING_LITERAL "%u, %u" const char string_const[ ] = "%u, %u"; snprintf(dest_buff, sizeof(dest_buff), STRING_LITERAL, arg1, arg2, arg3); My compiler then issues a Warning: the format string ends before…
MFM
  • 91
  • 1
  • 8
1
vote
1 answer

C printf Format Specifier %_fi

Does anyone know if an underscore as format specifier (like %_f) does anything in C code? I+ve found some code in a book that uses it, but I've googled and found nothing. I've also tested the following Objective-C code in Xcode and Xcode seems not…
1
vote
3 answers

How to read from standard input with format specifier

I want to scan in values and add 0's ahead of the number until it is 4 digits long. Example: scanf("%d",&value); //entering '4'..modify the scan somehow with format specifier? printf("%d",value); //prints 0004 or another…
user3507072
  • 287
  • 1
  • 4
  • 13
1
vote
0 answers

Payroll assignment in Java, I declared variables and assigned the right format specifiers... still getting error

I'm a beginner in Java, and I am receiving a format specifier error. Just want to say that I am required to use the printf statement here. Please see my code listed below: package assignmentproject1; /* CHANGE (FINAL) VAR NAMES, SCAN & VERIFY,…
ggx7
  • 49
  • 8
1
vote
2 answers

Is it possible that a declarator has zero declaration specifier?

Regarding the statement; Every object declaration in C and C++ has two principal parts: a sequence of zero or more declaration specifiers, and a sequence of one or more declarators, separated by commas. For example: Does zero specifier means…
haccks
  • 104,019
  • 25
  • 176
  • 264
1
vote
1 answer

Why there is a need for specifier-qualifier list?

I compiled this (gcc compiler): #include main() { struct { a:1; b:2; } t; t.b=6; t.a=2; printf("%d %d",t.a,t.b); } Error shown was: expected specifier-qualifier list before 'a' Why it is needed when…
Abhay
  • 129
  • 2
  • 11
0
votes
1 answer

NSLocalizedString with a Double and a specifier

I tried a lot of possibilities to specify only "2 digits" after the "." for this Double without success. I don't know where to add , specifier: "%.2f". // ContentView.swift Text(String(format: NSLocalizedString("text [%lf]", comment: "Item"),…
Alexnnd
  • 429
  • 4
  • 13
0
votes
1 answer

what happens when %x read signed char?

i thought *(p3 + 3) will print 90 but it shows ffffff90 why does it happend? i guess MSB is 1, and %x is for reading unsinged hexadecimal integer so it reads 90 like minus integer but it is not clear and i cant find about this problem at printf…
as df
  • 29
  • 6
0
votes
1 answer

C++ requires a type specifier for all declarations & Expected unqualified-id (Debugging help needed)

Edited* I made a few changes to the code and resolved the major issues. A few of the lines still have these errors, so I think a brief idea of what normally fixes these kinds of errors and what they actually mean should be about all that's left.…
FeeFae
  • 21
  • 6
0
votes
1 answer

Swap() func in the book Essential C does not compile

wtf.c:11:6: error: expected declaration specifiers or '...' before '&' token Swap(&a, &b); wtf.c:11:10: error: expected declaration specifiers or '...' before '&' token Swap(&a, &b); Did not want to resort to StackOverflow for my personal problem…
0
votes
2 answers

Expected specifier-qualifier-list before

I have the following Objective-C headers: // Menu.h #import #import "GameController.h" @interface Menu : UIImageView { GameController *gameController; // "Expected specifier-qualifier-list …
aniiye
  • 11
  • 1
0
votes
1 answer

C++ Struct function in an another header gives "missing type specifier"

I got in my "main.cpp" the following code: #include "rational.h" using namespace std; typedef struct rational { long long numerator; long long denominator; } rational_t; And I have a Header-file namend "rational.h": #pragma…
Nyht
  • 11
  • 1
0
votes
2 answers

Complex format specifier C

Can someone explain me what king of specifier is in the below code? and give me an example. printf("\r\x1b[32mConverting: \x1b[36m%d\x1b[0m",(Convert));
Paulo Gasol
  • 83
  • 1
  • 4
0
votes
0 answers

Missing type specifier despite correct namespace

I'm getting an error I typically see if I forget to add on the std:: to an object like string. In this case, its my own namespace called x. The specific errors are as follow: Error 59 error C2143: syntax error : missing ';' before '*' …
BossLetsPlays
  • 121
  • 1
  • 14