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. .NET (Core and Framework)
  4. How to read in multiple values from Console

How to read in multiple values from Console

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpc++tutorialquestion
3 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.
  • M Offline
    M Offline
    mmhu
    wrote on last edited by
    #1

    .NET VC++ the user will type three floats in the Console window, and the application will read in those three values and assign each to one variable. i.e. Console::WriteLine("Enter three values: "); Console::Readline() gets whole text line......how to extract the three values from a String*?? Is there other way to read values in???

    C 1 Reply Last reply
    0
    • M mmhu

      .NET VC++ the user will type three floats in the Console window, and the application will read in those three values and assign each to one variable. i.e. Console::WriteLine("Enter three values: "); Console::Readline() gets whole text line......how to extract the three values from a String*?? Is there other way to read values in???

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      mmhu wrote:

      Console::Readline() gets whole text line......how to extract the three values from a String*??

      Parse the string into the component values. I assume there is some sort of delimiter between the values. For example, do you type them in like this?

      1.1 2.2 3.3

      If so, then you can Split the string on the space character.


      Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        mmhu wrote:

        Console::Readline() gets whole text line......how to extract the three values from a String*??

        Parse the string into the component values. I assume there is some sort of delimiter between the values. For example, do you type them in like this?

        1.1 2.2 3.3

        If so, then you can Split the string on the space character.


        Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

        M Offline
        M Offline
        mmhu
        wrote on last edited by
        #3

        Thanks

        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