Extra characters appended to end of line in c
So, I am trying to print a string in C and I keep getting extra characters at the end of the string when I print it. Code:
char binaryNumber[16] = "1111000011110000";
printf("binary integer: %s\n", binaryNumber);
Output:
binary integer: 1111000011110000▒▒▒▒
Could you please help me figure out why this is happening. I think this is the root of some other problems in my code. I used to have this problem when I created a string in a more complex way and in this case I also got extra characters, but they were different. So I made the line in the most straightforward way (method shown here) and I still face the problem
+3
source to share