Getting some weird error, even though the output is matching with the expected va


#1

Getting some weird error, even though the output is matching with the expected value:

Your function returned the following :
aaaaa
The expected returned value :
aaaaa


#2

Even though I was allocating an extra byte for null character and using “strncpy” , i had to explicitly add a ‘\0’ to my string. Why is it needed ? strncpy should add it if the destination has extra space, isnt it ?


#3

yes getting same error, my ouput is abc and expected output is also abc but then also it is showing a error.