Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 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 June 13th, 2012, 11:04 AM
Registered User
 
Join Date: Jun 2012
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default Literal Values

Can anyone please explain what is meant by literal values .
 
Old June 26th, 2012, 09:36 PM
Authorized User
 
Join Date: Jan 2011
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default

Literal values are any hard coded values in C#; that is, any value you use in place of a variable.

Eg:
Code:
string name = "Peter"; //Peter is a literal string value

int age = 5; //5 is a literal integer value

double tuition = 300.0; //300.0 is a double literal value

decimal bonus = 100.0M; //100.0M is a decimal literal value

//etc.
As long as the value is hard coded; that is there is no way that the value can be changed at runtime, then the value is a literal.

Last edited by malie22001; June 26th, 2012 at 09:37 PM.. Reason: Code error





Similar Threads
Thread Thread Starter Forum Replies Last Post
Label vs Literal pinch BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 October 9th, 2007 01:01 PM
What's the use of braces in a string literal? aaaa0441 Beginning PHP 4 January 14th, 2007 08:10 AM
Literal Control bilal589 ASP.NET 1.0 and 1.1 Basics 5 August 19th, 2006 01:42 PM
Using right() to return a literal value Somed00d Access 4 February 8th, 2006 02:56 PM
Object literal syntax shortt Javascript 4 May 28th, 2005 07:44 PM





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