help showing amount of whitespace and characters

This is a discussion on help showing amount of whitespace and characters within the C++ Programming forums, part of the General Programming Boards category; can someone help me how to output things like percent of whitespace or characters please?...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    3

    help showing amount of whitespace and characters

    can someone help me how to output things like percent of whitespace or characters please?

  2. #2
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    I can help you conceptually, but without any code of your own I don't feel very motivated to write any myself.

    Conceptually: read from some input one character at a time, testing whether it's whitespace or not, incrementing running totals accordingly. Then do some math.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    3
    i need to input a string and then i need the program to differentiate between what is numbers, letters, whitespace, and all that stuff

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    266
    Quote Originally Posted by mattz714 View Post
    i need to input a string and then i need the program to differentiate between what is numbers, letters, whitespace, and all that stuff
    yea we understand what you have to do

  5. #5
    The Dragon Reborn
    Join Date
    Nov 2009
    Location
    Dublin, Ireland
    Posts
    629
    a loop and if statement
    that should get you started

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. new to C...need to eliminate whitespace
    By cakestler in forum C Programming
    Replies: 7
    Last Post: 02-02-2009, 11:41 AM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  4. Input from file no white space characters
    By Dan17 in forum C++ Programming
    Replies: 5
    Last Post: 05-09-2006, 08:28 AM
  5. counting whitespace characters
    By artec_19 in forum C Programming
    Replies: 1
    Last Post: 10-30-2003, 01:50 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21