Category "printf"

Printing strings and characters as hexadecimal in Go

Why cyrillic strings in hexadecimal format differ from cyrillic chars in hexadecimal format? str := "Э" fmt.Printf("%x\n", str) //result d0ad str :

Strange warning when calling sprintf with .* width specifier

For the following code: https://godbolt.org/z/WcGf9hEs3 #include <stdio.h> int main() { char temp_buffer[8]; double val = 25.3; sprint

What types of error when using the wrong format specifier in printf

Floating-point format specifier is used in printf by the argument has a integer number. What kind of error is it? Is it a run-time error or a syntax error? erro

How does printf("%d",x) work/interpreted?

I am wondering how exactly printf("%d",x) is interpreted. All I know that the compiler reserve a memory to put '%','%d','\0' and returns its address to printf,

C Programming, scanf() function output [closed]

When I run the program on a Cygwin terminal, I am not able to achieve the following output: 38 $92360.88 llama Notepad++ Cygwin Terminal Progr

How to print long double number in xinu?

Function sqrtl doesn't work here, also the printf of long double prints f for all given numbers: #include <conf.h> #include <kernel.h> #include <

How to avoid non-copyable characters in a C application, run by Eclipse

I am working with a C application, which is tested by a Java application, run in Eclipse. The Java application runs the C application, using the standard way: R

Why does printf behave differently when called from a Makefile?

The printf program can be used to print binary data, e.g.: $ printf '%b' '\xff\xff' �� If I put this in a Makefile on its own, it works the same:

Why is ANSI printing the code the first time the function is called and printing colours the second time around?

I am trying to change the colour output of my printf statements in a connect 4 game. I have made a function to set the print colour and reset it. It works for m

How to create 24 bit unsigned integer in C

I am working on an embedded application where RAM is extremely tight. For this purpose I need to create a 24 bit unsigned integer data type. I am doing this us

Remove percentage printf and shell

I'm beginning to learn the shell commands. And I don't know how to remove the percent character in the end. Example: printf poo shows poo% I'm on mac and I us

sprintf-like function for CUDA device-side code?

I could not find anything in internet. Due to the fact that it is possible to use printf in a __device__ function I am wondering if there is a sprintf like func

Why wasn't a specifier for `float` defined in `printf`?

It looks like it could have been, there are (at least in C99) length modifiers that can be applied to int: %hhd, %hd, %ld and %lld mean signed char, short, long

Printing more than one array using print_r or any other function in php

I need to print contents of multiple arrays in my code. Eg function performOp($n, $inputArr, $workArr) { printf("Entered function, value of n

Why is printf round floating point numbers up?

I am trying to print some floating point numbers using printf. For example: int main() { printf("%.1f",76.75); return 0; } Output: 76.8 And I have som

Minimal implementation of sprintf or printf

I'm working on an embedded DSP where speed is crucial, and memory is very short. At the moment, sprintf uses the most resources of any function in my code. I o

Minimal implementation of sprintf or printf

I'm working on an embedded DSP where speed is crucial, and memory is very short. At the moment, sprintf uses the most resources of any function in my code. I o