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 reference https://cplusplus.com/reference/cstdio/printf/ is there anyone who explain this?
1
There are 1 best solutions below
Related Questions in C
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in PRINTF
- What are the limits on CUDA printf arguments?
- command in bash contains printf but the format is not hand over to variable
- va_args in c from <stdarg.h> does not work correctly
- convert sprintf() statement to printf() statement in awk
- Is there any way to recover from a printf()/puts() error?
- can't understand why this output is generated
- Convert a file of decimal numbers to the ASCII equivalent
- When printing string why I am getting warning when constant qualifier not used in c?
- Java printf not working as expected when dividing
- Initializing a Variable for Strings Using Ternary Operators in C
- how printf() function behaves in printf("%d %d %d",a,a=a+5,a);?
- printf(%d) printing a very big integer
- Why does bidimensional char array behave this way in C?
- How to prevent race condition when multiple threads are writing in the same file descriptor in C?
- Why is fprintf not working as intended in my code?
Related Questions in SPECIFIER
- VUE/VITE Problem: Uncaught TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../"
- What does %s(%s) specifier do?
- Uncaught (in promise) Error: Unable to resolve bare specifier '@microsoft/signalr'
- C++ Multiple Classes in ONE cpp file
- NSLocalizedString with a Double and a specifier
- what happens when %x read signed char?
- printf "%n" specifier not working properly
- 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
- C++ requires a type specifier for all declarations & Expected unqualified-id (Debugging help needed)
- Swiftui specify double format
- Why is the output of the code snippet printf("%. %. %. "); comes to be %.0 %.0 %.0?
- Why does printf specifier format %n not work?
- Swap() func in the book Essential C does not compile
- C preprocessor define to replace string format specifier
- C float or double in printf format specifier and pow function
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

Use an
unsigned char *.In your environment,
charis signed.charis 8 bits.So you have a
charwith a bit pattern of 9016. In this environment, that's -112. So you are effectively doing the following:When passing to variadric function like
printf, the smaller integer types are implicitly promoted tointorunsigned int. So what's really happening is this:So you're passing the
intvalue -112. On your machine, that has the bit pattern FF FF FF 9016 (in some unknown byte order).%xexpects an unsigned integer, and thus prints that bit pattern as-is.