What is the method to avoid return random value in the end of the character array ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the method to avoid return random value in the end of the character array ?

l have been experienced the '\0' and it dosn't work.

27th Jun 2018, 12:31 PM
Omar Muhammad Nofal
Omar Muhammad Nofal - avatar
5 Answers
+ 1
if i run your code, i get the output:"i use sololearnt" the only error i saw was, that you wrote srtlen instead of strlen in the line: t[srtlen(t)+1]='\0';
27th Jun 2018, 9:10 PM
Max
Max - avatar
+ 1
works for me, but your srtlen should be strlen
27th Jun 2018, 3:24 PM
Max
Max - avatar
27th Jun 2018, 1:33 PM
Omar Muhammad Nofal
Omar Muhammad Nofal - avatar
0
i didnt understand
27th Jun 2018, 7:59 PM
Omar Muhammad Nofal
Omar Muhammad Nofal - avatar
0
thanks
28th Jun 2018, 2:10 AM
Omar Muhammad Nofal
Omar Muhammad Nofal - avatar