-2
In C I can scan more than one string as is done with integers?
Type:
scanf("%s %s", pal1, pal2);
-2
In C I can scan more than one string as is done with integers?
Type:
scanf("%s %s", pal1, pal2);
2
#include <stdio.h>
int main(void) {
char pal1[100], pal2[100];
scanf("%s %s", pal1, pal2);
printf("%s - %s", pal1, pal2);
}
Behold working in the ideone. And in the repl it.. Also put on the Github for future reference.
-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 c string scanf
You are not signed in. Login or sign up in order to post.
The question is C or C#?
– Maniero
C msm. Apologies
– Paulo Henrique