Thread: I am really confused with the whitespaces concept [HELP ME]!

  1. #1
    Registered User
    Join Date
    Sep 2015
    Posts
    1

    I am really confused with the whitespaces concept [HELP ME]!

    Hi i am a beginner a at programming
    so I have a program with switch case conditional statement which expects a char but i am confused a lot with the whitespaces topic
    I am really confused with the whitespaces concept [HELP ME]!-2015-09-18-00_52_11-switch_operators-[switch_operators-dev]-dev-cplusplus-5-11-pngI am really confused with the whitespaces concept [HELP ME]!-2015-09-18-00_52_32-e__backstage-pass_first-year_semister-1_projects_c_9_switchoperators_switch_-png this is my program and the result where is does not ask for the character value

    and i wrote another program because someone told me that a leading newline tab space are considered as whitespace and are taken a char values but in this program seems to be working it takes the input properly
    I am really confused with the whitespaces concept [HELP ME]!-2015-09-18-00_51_09-project1-[project1-dev]-dev-cplusplus-5-11-png

    i am totally confused can anyone help me please

    thanks in advance!

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Print the value of the invalid input as an integer. Check what character has that value in say, an ASCII table. Based on this observation, what could be the problem?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Whitespaces in Strings
    By dE iNSANE in forum C Programming
    Replies: 4
    Last Post: 01-26-2012, 07:46 AM
  2. Trim whitespaces
    By Pingoo in forum C Programming
    Replies: 13
    Last Post: 06-27-2010, 02:20 PM
  3. whitespaces
    By happyclown in forum C Programming
    Replies: 2
    Last Post: 01-06-2009, 10:33 PM
  4. sscanf & whitespaces
    By hannibar in forum C Programming
    Replies: 1
    Last Post: 05-10-2006, 09:06 AM
  5. scanf and whitespaces
    By rkooij in forum C Programming
    Replies: 25
    Last Post: 03-08-2006, 03:55 AM

Tags for this Thread