Relative Content

Tag Archive for cstringnullstrcmpnull-terminated

Struggling with strings in c – issues will null terminator

I don’t understand how there is uninitialised variable access in my code and stack buffer overflow even though the two strings are the same when debugging. When i add a null terminator to str2 it also does not fix the issue. When I use fgets the null terminator issue persists. How can i address this? And could someone explain why this is happening and what to look for when doing similar problems.