|
|
 |
BOOK: Beginning Visual C#  | This is the forum to discuss the Wrox book Beginning Visual C#, Revised Edition of Beginning C# for .NET v1.0 by Karli Watson, David Espinosa, Zach Greenvoss, Jacob Hammer Pedersen, Christian Nagel, Jon D. Reid, Matthew Reynolds, Morgan Skinner, Eric White; ISBN: 9780764543821 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning Visual C# section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

May 9th, 2008, 02:42 PM
|
|
Registered User
|
|
Join Date: May 2008
Location: , Florida, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chapter 3 Page 51
I'm just beginning and I hope this question isn't too silly but I don't understand the statement:
firstNumber = Convert.ToDouble(console.ReadLine());
It is the Convert.ToDouble portion that I don't understand. I want to get a good handle on this before moving forward.
Your assistance is greatly appreciated!:)
|

November 7th, 2009, 01:25 PM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Hi
very good question.Thanks because you want to build the base and then move forward.
OK.Remember that when you input sth through console it is saved as a string.the complier treats it as a string or array of characetrs.firstNumber's type is certainly double,right?So can you save characters in a variable of type double?NO you can't.
because of this you convert every block of this array to double.although you have enterd
numbers,the compiler thinks it is a string like "dog"(4 example).
note that if your input contains any character like "2154A" you will encounter an exception and program terminates showing you the line that caused exception and you should handle this line.If you don't know about exception handling,don't panic,you will learn in following chapters.
Hope it Helps
Erfan...
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |