0
Does Printf Automatically add \n when it prints strings(%s) C LANGUAGE
The question is in the title. I've written a code and even though in this string input[0] to input [100] is = '\0' when I use printf("%s", input) it also prints a newline although there is not any \n character in the elements of string. If this is the case and if there is a way to prevent it I'd like to change it because it's the essential of the code. Edit: Thank you for your answer. I was mistaken and your answer helped me to recognize that. The problem's solved.
2 ответов
+ 3
can you show the code, your question seem not to be clear enough, and printf don't add newline only puts and fputs do that
0
I've messaged you