Initials of name | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

Initials of name

I have written a code of string manipulation in c. In this a particular section shorten long names by initials . For example Amitabh Bachchan Singh Output should be A. B. Singh But the error in my code is Output is A. B. S https://sololearn.com/compiler-playground/c74FoF9YyEEa/?ref=app https://sololearn.com/compiler-playground/c74FoF9YyEEa/?ref=app https://sololearn.com/compiler-playground/c74FoF9YyEEa/?ref=app

27th Apr 2024, 6:32 AM
Vishnu Swarnkar
7 ответов
+ 4
Vishnu Swarnkar , for future use of the `q&a` section, please mention the *programming language* you are talking about. this makes readers able to see this information in the list overview of this section.
27th Apr 2024, 5:20 PM
Lothar
Lothar - avatar
+ 2
You're calling the spaces function before it's defined or declared. And gets() doesn't perform any bounds checking, which can lead to buffer overflow vulnerabilities lead to an error. So, you should use fgets() which allows you to specify the maximum number of characters to read. These are issues you need to fixed this code!
27th Apr 2024, 7:25 AM
`нттp⁴⁰⁶
`нттp⁴⁰⁶ - avatar
+ 1
Ok
28th Apr 2024, 1:03 PM
Vishnu Swarnkar
0
Still not working 😭
27th Apr 2024, 7:45 AM
Vishnu Swarnkar
0
Not even now the output should be A B Singh
27th Apr 2024, 8:20 AM
Vishnu Swarnkar
0
Vishnu Swarnkar Check this I fixed it!
27th Apr 2024, 11:00 AM
`нттp⁴⁰⁶
`нттp⁴⁰⁶ - avatar