Question dealing with Array print commands

Need another small advice about following:

Could someone explain me what will happen if we have an Array of chars named str and this array doesn't contain the blank character (‘\0’) and try to execute the command: printf("%s", str); Can someone give an explanation please ?

Thanks in advance.....

The printf instruction will print out the dirty data which are after the str. So it is rewarding to put '\0' at the end of your string
Topic archived. No new replies allowed.