473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to cast variables using letters

hello everyone,

i seen some code that declared a float like this:

float f = 0.5F;

is there a chart somewhere that oulines all the letters for the data types.
i'm not sure what keyword to even search for.

thanks for your help.
Nov 6 '06 #1
4 1425

"Abraham Andres Luna" wrote...
i seen some code that declared a float like this:

float f = 0.5F;

is there a chart somewhere that oulines all the letters for the data
types.
i'm not sure what keyword to even search for.
The letter is called a "literal suffix".

I don't know if there's a table for them, but you can find them in the
specs:

http://msdn.microsoft.com/library/de...ec_2_4_4_3.asp

http://msdn.microsoft.com/library/de...ec_2_4_4_2.asp
/// Bjorn A
Nov 6 '06 #2
Abraham

It is part of the c# language specification. They can be found in section
9.4.4 Literals.

Here is a link that I found for online specs

http://www.jaggersoft.com/csharp_standard/9.4.4.htm

click on the different types of literals and look for literal sufixes.
--
HTH
Stoitcho Goutsev (100)
"Abraham Andres Luna" <br******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
hello everyone,

i seen some code that declared a float like this:

float f = 0.5F;

is there a chart somewhere that oulines all the letters for the data
types.
i'm not sure what keyword to even search for.

thanks for your help.


Nov 6 '06 #3
thanks for the replies. it looks like there are not suffixes for shorts :(
"Abraham Andres Luna" <br******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
| hello everyone,
|
| i seen some code that declared a float like this:
|
| float f = 0.5F;
|
| is there a chart somewhere that oulines all the letters for the data
types.
| i'm not sure what keyword to even search for.
|
| thanks for your help.
|
|
Nov 6 '06 #4
Abraham,

If you are talking about Int16 then no there is no suffix for that. Just
type the number. As a matter of fact if you put suffix it wont compile.
--
Stoitcho Goutsev (100)

"Abraham Andres Luna" <br******@hotmail.comwrote in message
news:eV**************@TK2MSFTNGP03.phx.gbl...
thanks for the replies. it looks like there are not suffixes for shorts :(
"Abraham Andres Luna" <br******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
| hello everyone,
|
| i seen some code that declared a float like this:
|
| float f = 0.5F;
|
| is there a chart somewhere that oulines all the letters for the data
types.
| i'm not sure what keyword to even search for.
|
| thanks for your help.
|
|


Nov 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Michael | last post by:
I've written a simple class that puts together a MySQL SELECT query and allows you to extend the query, but I'm unsure as to when to use $this - > var_name and when I can just use $varname, and...
4
by: Andrew | last post by:
Newb here... For one of my programs I want to initialize a variable for each letter of the alphabet. For example, a,b,c = 0,0,0. I don't think this works, but I'm wondering if I can do something...
2
by: deko | last post by:
I use variables in some links on my page. I need to send these variables so I can change the color of the links in the navbar when the user is on that page. If you click around on the site you...
14
by: google-newsgroups | last post by:
Hello, even (or because?) reading the standard (ISO/IEC 9899/1999) I do not understand some issues with volatile. The background is embedded programming where data is exchanged between main...
25
by: Daniel Bass | last post by:
how do i declare a global variable in c#.net? it's like it want's everything in classes... there are times when globals are good, like having constants in a program which apply to several...
44
by: fabio | last post by:
Why? i' ve heard about this, the usage of global vars instead of locals is discouraged, but why? thx :)
9
by: Hamish M | last post by:
Hi I am interested in opinions on this topic. I have heard that a suffix is not a good solution and type casts are much better for example. ...
5
by: aaragon | last post by:
Hi everyone, I wrote a very simple function to try to understand the casting of variables in C++. The function is function foo() { std::vector<inttest(100); randomize(test); unsigned long...
20
by: raylopez99 | last post by:
Inspired by Chapter 8 of Albahari's excellent C#3.0 in a Nutshell (this book is amazing, you must get it if you have to buy but one C# book) as well as Appendix A of Jon Skeet's book, I am going...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.