Thread: Newbie Question

  1. #1

    Newbie Question


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

    Thanks in advance

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

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Hannover, Germany
    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

    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, 06:45 PM
  3. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 04:38 PM
  4. confusion with integers (newbie question)
    By imortal in forum C Programming
    Replies: 7
    Last Post: 12-06-2002, 04:09 PM
  5. newbie class templates question
    By daysleeper in forum C++ Programming
    Replies: 2
    Last Post: 09-18-2001, 09:50 AM