parsing line and getting junk at particular position and for particular amount of data | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

parsing line and getting junk at particular position and for particular amount of data

https://code.sololearn.com/c02T5mkO17J5 Hi friends here I wrote a code for parsing the line like key and value . If I run this code in my gcc compiler I am getting junk data at first value if I give that value 12 characters... If I give 11 or 13 characters I am not getting junk at last of that value. But if I give 12 characters for first value then only getting junk at end of that value. why It's getting junk at last of first value if we give 12 characters.....I am not getting ......could you please explain .. Thank you

25th Jul 2019, 5:14 AM
malepu rakesh
malepu rakesh - avatar
3 Answers
+ 1
Thank you swim
25th Jul 2019, 9:50 AM
malepu rakesh
malepu rakesh - avatar
+ 1
Hooo...okay.. you mean we need not to take int return type... if we use only return
25th Jul 2019, 10:39 AM
malepu rakesh
malepu rakesh - avatar
0
Actually when I read the data in runtime... then if I not give any data. Then I am getting segmentation fault .....that's why I used return there.
25th Jul 2019, 10:31 AM
malepu rakesh
malepu rakesh - avatar