|
From: Santiago P. C. <San...@yd...> - 2002-11-26 10:15:46
|
Yes, it is possible! Use a string variable to hold user's input value, then check its content and convert it to integer if appropriate (store integer value in a new variable, of course). Then you'll be able to use this integer value... Regards, ~Santy -----Original Message----- From: Olu...@ao... [mailto:Olu...@ao...] Sent: martes, 26 de noviembre de 2002 10:53 To: dev...@li... Subject: [Dev-C++] Function Syntax C++ I want to write a function that will validate my C++ prgram. I want the function to display a message if wrong value type is entered. For example - int number1; cout << " Enter your number. The number must be between 1 and 4: " ; cin >> number1; if the user enter, a char value instead of a int value, i want the function to display a message of violation of variable type. Is it possible to write this type of function and what is the syntax. thnaks olu...@ao... -------------------------------------------------------------------------------------- This message and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. No confidentiality or privilege is waived or lost by any wrong transmission. If you have received this message in error, please immediately destroy it and kindly notify the sender by reply email. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Opinions, conclusions and other information in this message that do not relate to the official business of Ydilo Advanced Voice Solutions, S.A. shall be understood as neither given nor endorsed by it. -------------------------------------------------------------------------------------- |