Scan more than one string

Asked

Viewed 136 times

-2

In C I can scan more than one string as is done with integers?

Type:

scanf("%s %s", pal1, pal2);
  • The question is C or C#?

  • C msm. Apologies

2 answers

2


-1

Dude, scanf is C, In C#: https://msdn.microsoft.com/pt-br/library/system.console.readline(v=vs.110). aspx? Cs-save-lang=1&Cs-lang=csharp#code-snippet-1

Example from microsoft:

using System;

public class Example
{
   public static void Main()
   {
      Console.Clear();

      DateTime dat = DateTime.Now;

      Console.WriteLine("\nToday is {0:d} at {0:T}.", dat);
      Console.Write("\nPress any key to continue... ");
      Console.ReadLine();
   }
}
// The example displays output like the following:
//     Today is 10/26/2015 at 12:22:22 PM.
//     
//     Press any key to continue...
  • The question has already made it clear that it is in C, your answer was out of context

  • Yesterday he had quoted C# in the title, so I put the answer.

  • Yes, in the body of the question, but in the tags tava C, I was confused: https://answall.com/revisions/238214/1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.