Thread: Getting rid of spaces in C

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    103

    Getting rid of spaces in C

    I am trying to get rid of spaces from input. How would I do that? Thanks.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Do you have the input in a char array, now?

    Is a for loop ok to use?

    Post up your try at it, please.

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    scanf with most formats does it automatically
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing 3 spaces to tabs
    By dnguyen1022 in forum C Programming
    Replies: 2
    Last Post: 12-22-2008, 12:51 AM
  2. Handling spaces in command line arguments
    By starkhorn in forum C++ Programming
    Replies: 7
    Last Post: 11-16-2004, 02:42 PM
  3. Getting rid of spaces in a string
    By David101 in forum C Programming
    Replies: 38
    Last Post: 09-23-2004, 09:01 PM
  4. Getting rid of spaces in a string
    By scythe in forum C Programming
    Replies: 3
    Last Post: 10-23-2003, 04:05 AM
  5. Replies: 5
    Last Post: 06-30-2003, 12:52 PM