The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > General Programming > C / C++


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags:

Closed Thread
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 06-10-2007, 04:58 PM
Matt B
Posts: n/a
[SOLVED] C++ program help?

Just a quick question, and I am embarrassed to even have to ask because it sounds so simple. I am finishing my homework and i am almost done, but i am stuck.

See, I am doing throw/catch problems, and i have all I need EXCEPT one thing. I forgot how to check to see if the input is the type of the variable, such as int.

Right now, I need a throw statement for if the number entered in an int variable is only an int, not a char or string or anything else.

I am embarrassed not to know this, but please, how do I check to see if a variable the user inputs is indeed the correct type?
basically I am asking the user to type in an integer for Feet, and part of the homework (that I already have typed up) is to create a throw/catch statement if the user inputs anything but an integer, such as a C or a &, and the condition for the throw would be if what is input is not an integer then catch and ask them to put it in again.

I just need to know how to make it so the program checks to see if it is an integer that was typed in and if not throw/catch it.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #2 (permalink)  
Old 06-10-2007, 04:58 PM
franz
Posts: n/a
Just input a reminder that they use an integer and not a letter...as simple as that.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Closed Thread


Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 07:19 AM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50