printf tag

11 questions


1 answers
88 views
0
Why doesn't printf print out if I don't write the opening letter?

Why doesn't printf automatically print out if you don't write the opening letter?Is that what POSIX decided? How do I automatically print out every time I printf()?

1 years ago

1 answers
70 views
0
Binary format specifier in printf

All I know is decimal, octal, hexadecimal outputIs there a binary formatter?I'm using gcc. I hope I can use it like the code belowprintf(%d %x %o\n, 10, 10, 10); //10 A 12\nprint(%b\n, 10); //%b\n

1 years ago

1 answers
78 views
0
Type specifier %i, %d difference

I know that you can use both the format specifiers %i and %d when printing integers. What's the difference between you two? Did you make it separately?

1 years ago

1 answers
67 views
0
Questions about c++ cout

Hello, everyone I am a student studying c++.I am inquiring because there is something strange while studying c++.==================char c = 'a';char *d = &c;cout << d << endl;printf(%p...

1 years ago

1 answers
82 views
0
C++에서 printf랑 cout은 무슨 차이가 있나요?

What is the difference between printf and cout in C++?Well, printf has to use a separate format designator, so it's annoying...What's the difference other than this?

1 years ago

1 answers
117 views
0
How do I print "unsigned long"?

I know how to output the int, long, float, and double types in CI don't know how to print unsigned longprintf(%lu\n, unsigned_boo)printf(%du\n, unsigned_boo)printf(%ud\n, unsigned_boo)printf(%ll\n, un...


1 answers
80 views
0
I keep getting negative numbers for long in printf

long mylong = 1000000000000000000;printf(%d, mylong);Output: -1486618624 I don't know what you call that %d thingI don't think all the long types go in ㅜㅜIf I write %f, it looks like 0.0000 so what sh...

1 years ago

1 answers
66 views
0
How do I output size_t on 32-bit and 64-bit?

You want to print out the size_t type variable using printf.When compiled into g++-g-Wall-Werror-ansi-pedantic using %u on 32-bit,It was printed without a problem, but it's not working because it's 64...

1 years ago

1 answers
66 views
0
I'd like to know the format specifier of the C bowl type

Linux kernel code writes bowl. Is this okay?If you look at From ANSI C99, _Bool or stdbool.h has _BoolThen, where is the format specifier that makes it true/false instead of 1 or 0 output?bool x = tru...

1 years ago

2 answers
73 views
0
How can I fully print the unsigned long int?

#include <stdio.h>int main() { unsigned long long int num = 285212672; //FYI: fits in 29 bits int normalInt = 5; printf(%ul is %d bytes; int value is %d.\n, num, sizeof(num), normalInt); return ...

- 1 - »

© 2024 OneMinuteCode. All rights reserved.