Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2008, 12:40 PM
Authorized User
 
Join Date: Jan 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Doom
Default Reading An int

Hello there. I have defined an int

Code:
int number;
how can i take user input so that the user enters there number and it stores in an int (int number).

Thanks.
 
Old January 7th, 2008, 01:43 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Depends where you want to get the users input from. Is this a console app, a windows app, a web app?

I suggest you look at the Integer.TryParse() method, or the Convert.ToInt32() method for more informaton on converting strings to integers.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting int to byte yukijocelyn C# 2005 1 May 30th, 2008 03:44 AM
int? asn187 C# 2 March 30th, 2007 06:05 AM
What's the difference between an int and a long jnrico C++ Programming 4 March 4th, 2007 01:29 AM
how can I get the int value from Session[" "] iaarm88 Classic ASP Databases 2 February 8th, 2005 03:38 AM
Converting int to string Judex C++ Programming 3 March 1st, 2004 10:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.