how to cast variables using letters

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Abraham Andres Luna

    #1

    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.


  • Bjorn Abelli

    #2
    Re: how to cast variables using letters


    "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


    Comment

    • Stoitcho Goutsev \(100\)

      #3
      Re: how to cast variables using letters

      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

      Hi. I'm Jon Jagger, director of software at Kosli. I built cyber-dojo, the place teams practice programming.


      click on the different types of literals and look for literal sufixes.


      --
      HTH
      Stoitcho Goutsev (100)


      "Abraham Andres Luna" <brag1518@hotma il.comwrote in message
      news:%237OLh5bA HHA.3560@TK2MSF TNGP03.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.
      >
      >

      Comment

      • Abraham Andres Luna

        #4
        Re: how to cast variables using letters

        thanks for the replies. it looks like there are not suffixes for shorts :(


        "Abraham Andres Luna" <brag1518@hotma il.comwrote in message
        news:%237OLh5bA HHA.3560@TK2MSF TNGP03.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.
        |
        |


        Comment

        • Stoitcho Goutsev \(100\)

          #5
          Re: how to cast variables using letters

          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" <brag1518@hotma il.comwrote in message
          news:eVLBJqcAHH A.4740@TK2MSFTN GP03.phx.gbl...
          thanks for the replies. it looks like there are not suffixes for shorts :(
          >
          >
          "Abraham Andres Luna" <brag1518@hotma il.comwrote in message
          news:%237OLh5bA HHA.3560@TK2MSF TNGP03.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.
          |
          |
          >
          >

          Comment

          Working...