Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. char [ ] to float?

char [ ] to float?

Scheduled Pinned Locked Moved C#
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    levis
    wrote on last edited by
    #1

    hi all!i have a code like this.The port.Read(4) mean that i read 4 bytes from serial port..i had convert from byte [] to char [] and now i want to convert from char [] to float? mean that my final answer must be in float type.How can i do it?Thanks! private char [] Read_Data = new char[4]; { Read_Data = Encoding.ASCII.GetChars(port.Read(4)); }

    E 1 Reply Last reply
    0
    • L levis

      hi all!i have a code like this.The port.Read(4) mean that i read 4 bytes from serial port..i had convert from byte [] to char [] and now i want to convert from char [] to float? mean that my final answer must be in float type.How can i do it?Thanks! private char [] Read_Data = new char[4]; { Read_Data = Encoding.ASCII.GetChars(port.Read(4)); }

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      play around System.Convert.Tofloat() or ToDouble sorry if I is not correct. << >>

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups