How can I remove the leading spaces from a string in C?

Việt Quân

New member
How can I remove the leading spaces from a string in C?
Answer
Logic to remove leading white space
  1. Input string from user, store it in some variable say str.
  2. Declare a variable to store last index of leading white space character, say index = -1. …
  3. Run a loop from start till leading white space characters are found in str.
20 апр. 2016 г.
 

Tìm kiếm

Back
Top