Absorbing a String with Spaces in C - Programming - HWzone Forums
Skip to content
  • Create an account
  • About Us

    Hello Guest!

    Please note - in order to participate in our community, comment and open new discussions, you must join as a registered member.

    Our members enjoy many advantages, including the ability to participate in discussions, enjoy raffles and promotions for members of the site, and receive our weekly content directly by email.

    Do not like being harassed by email? You can register for the site but do not submit your registration to the weekly email updates.

Absorbing a string with spaces in C


Recommended Posts

Hey :)

I need to pick up a string in C that can also contain spaces.

When I do this in scanf it stops the reception after the gain.

I would love to know how it is possible for the string to absorb profits as well.

Just note that we did not learn the get function for reception (we only learned scanf and getchar).

Thank you!

Link to content
Share on other sites

Quote of multicore

Is there anything you tried and failed or did not understand?

Basically, there is more than one method to receive a string with spaces, beyond the use of gets:


With scanf does not work for me. It is not possible to receive spaces with scanf

Edited By lina12
Link to content
Share on other sites

Join the discussion

You can then join the discussion and then join our community. If you already have an account with us, please Log in now To comment under your username.
Note that: The comment will appear to the surfers after approval by the board management team.

Add a comment

×   The content pasted is with formatting.   Remove formatting

  Only 75 emoji are allowed.

×   Your link has been automatically assimilated.   Show as regular link

×   Your previous content has been automatically restored.   Clear all

×   You can not paste images directly. Upload or insert images from URL.


  • Create new ...

At the top of the news:

new on the site