Newbie Question

This is a discussion on Newbie Question within the C# Programming forums, part of the General Programming Boards category; Hi, How do i do something like: cin >> myString. Using C#? Thanks in advance...

  1. #1
    Daniel
    Guest

    Newbie Question

    Hi,

    How do i do something like: cin >> myString. Using C#?

    Thanks in advance

  2. #2
    Registered User Cela's Avatar
    Join Date
    Jan 2003
    Posts
    362
    Code:
    using System;
    
    class ReadString {
      public static void Main()
      {
        string myString;
        
        Console.Write("Enter a string: ");
        myString = Console.ReadLine();
        Console.Write("You entered: " + myString);
      }
    }
    *Cela*

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,138
    string s;

    System.Console.Writeline( "Please enter a string:" );
    s = System.Console.Readline();
    System.Console.Writeline( "You entered: {0}", s );


    Edit: oops, same minute *g* Cela beat me
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Newbie question
    By TimL in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2008, 04:43 AM
  2. C prog newbie question
    By Draginzuzu in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 05:45 PM
  3. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 03:38 PM
  4. confusion with integers (newbie question)
    By imortal in forum C Programming
    Replies: 7
    Last Post: 12-06-2002, 03:09 PM
  5. newbie class templates question
    By daysleeper in forum C++ Programming
    Replies: 2
    Last Post: 09-18-2001, 09:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21