473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Newby Question

I have a console application that I am trying to build that is looking for
the users input. I have declared one of my variables as char and the user
has to select a category code from a list. The Category codes are C through
H and AA, BB and CC. When I try to run the program, I get the error: Too
many characters in character literal. The error is on the line where I have
the AA, BB, CC enter. You can't use = = to check the variable with a char
or string, so what must I do to be able to verify the the users input for
these values???

Brian
Nov 16 '05 #1
2 1089
Hi Brian,

It would probably work better if you made your variable a string, which can
hold multiple characters such as AA or BB.

Joe
--
http://www.csharp-station.com

"Brian" <ja******@bellsouth.net> wrote in message
news:aT*******************@bignews5.bellsouth.net. ..
I have a console application that I am trying to build that is looking for
the users input. I have declared one of my variables as char and the user
has to select a category code from a list. The Category codes are C through H and AA, BB and CC. When I try to run the program, I get the error: Too
many characters in character literal. The error is on the line where I have the AA, BB, CC enter. You can't use = = to check the variable with a char or string, so what must I do to be able to verify the the users input for
these values???

Brian

Nov 16 '05 #2
Thanks, I just tried that and it worked.

"Joe Mayo" <jm***@nospamAtCSharpDashStation.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Brian,

It would probably work better if you made your variable a string, which
can
hold multiple characters such as AA or BB.

Joe
--
http://www.csharp-station.com

"Brian" <ja******@bellsouth.net> wrote in message
news:aT*******************@bignews5.bellsouth.net. ..
I have a console application that I am trying to build that is looking
for
the users input. I have declared one of my variables as char and the
user
has to select a category code from a list. The Category codes are C

through
H and AA, BB and CC. When I try to run the program, I get the error: Too
many characters in character literal. The error is on the line where I

have
the AA, BB, CC enter. You can't use = = to check the variable with a

char
or string, so what must I do to be able to verify the the users input for
these values???

Brian


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Damien | last post by:
I have just built a simple stopwatch application, but when i f5 to get things goings i get this message, An unhandled exception of type 'System.ArithmeticException' occurred in...
0
by: Pete | last post by:
Hi All, A total Newby with, possibly, a daft question? However, until I can get a reasonable explanation I am disinclined towards going further. Here goes: I recently downloaded the latest...
8
by: Ask | last post by:
G'day All, Just thought I'd drop in and say hi. I'm new to Python, but old to software development. Python is one of the languages used in my new job, so I've just bought a book, read it, and...
10
by: Fred Nelson | last post by:
Hi: I have programmed in VB.NET for about a year and I'm in the process of learing C#. I'm really stuck on this question - and I know it's a "newby" question: In VB.NET I have several...
4
by: Fred Nelson | last post by:
I have an applicatioin that I'm writing that uses a "case" file that contains over 350 columns and more may be added in the future. I would like to create a dataset with all the column names and...
4
by: Fred Nelson | last post by:
Hi: I'm developing a web application that needs to have five values, each retrieved from cookies on many pages. If I have five "Request.Cookies" commands together does this cause five "round...
2
by: Fred Nelson | last post by:
Hi: I'm working on a VS2005 web application and I have what is probabably a "newby" question. In VS2003 I could drag a textbox/button/etc on to a form and position it with the mouse. I...
2
by: johnnyG | last post by:
Greetings, I'm studying for the 70-330 Exam using the MS Press book by Tony Northrup and there are 2 side-by-side examples of using the SHA1CryptoServiceProvider to create a hash value from a...
10
by: Charles Russell | last post by:
Why does this work from the python prompt, but fail from a script? How does one make it work from a script? #! /usr/bin/python import glob # following line works from python prompt; why not in...
5
by: alexrixhardson | last post by:
Hi guys, I am a newby in the C/C++ world, and I am beginning to work on a rather simple TCP/IP proxy application which must be able to handle large volume of data as quickly as possible. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.