p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > C# and C > C# 1.0 > BOOK: Beginning Visual C#
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 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
Default 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!:)


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 7th, 2009, 01:25 PM
Registered User
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 35%
Activity: 35% Activity: 35% Activity: 35%
 
Join Date: Nov 2009
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 9 Page 304 AspNetGuy BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 9 January 11th, 2009 12:57 PM
Error on source code 7-51? fedrok BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 October 15th, 2008 11:51 AM
Typographical error on page 51 Ketil BOOK: Professional .NET 2.0 Generics 1 July 14th, 2008 01:06 AM
select ONLY records 51-100 in a MySQL table crmpicco Classic ASP Databases 2 February 24th, 2005 07:21 AM
Chapter 1 page 74 dryan BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 16th, 2004 03:16 PM



All times are GMT -4. The time now is 06:50 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc