Your last print says to print the character pointed to by str
as a decimal, which is exactly what it did (for a memory location you just deallocated, making this undefined behavior).
More Related Contents:
- Seriously What's wrong in my code
- Should C compilers immediately free "further unused" memories? [closed]
- Why doesn’t ++ increment integer value?
- How to write a binary integer to binary file | c [closed]
- Using GCC to produce readable assembly?
- C dynamically growing array
- Are negative array indexes allowed in C?
- How do I base64 encode (decode) in C?
- When was the NULL macro not 0?
- Is this C implementation of Fisher-Yates shuffle correct?
- Is it safe to read past the end of a buffer within the same page on x86 and x64?
- C: Run a System Command and Get Output? [duplicate]
- Difference between scanf and scanf_s
- How to pass an array of Swift strings to a C function taking a char ** parameter
- How to implement getch() function of C in Linux?
- Why does stdout need explicit flushing when redirected to file?
- Does the size of pointers vary in C? [duplicate]
- C – split string into an array of strings
- Does unaligned memory access always cause bus errors?
- How to find the socket connection state in C?
- Kernel zeroes memory?
- Need to know when no data appears between two token separators using strtok()
- C function with no parameters behavior
- Wrong format specifiers in scanf (or) printf
- Why does forking my process cause the file to be read infinitely
- What does a dot before the variable name in struct mean?
- How do I reimplement (or wrap) a syscall function on Linux?
- Memory map for a 2D array in C
- Is conversion from unsigned to signed undefined?
- How to fgets() a specific line from a file in C?