0
Hi, I’m trying to do a very basic cmd, but I’m having problems...
My code:
#include <stdio.h>
int main()
{
char arg[300];
scanf("print '%s'", arg);
printf("%s", arg);
fgetc(stdin);
fgetc(stdin);
return 0;
}
So I went to test:
entrada: print 'hello world'
saída: hello //não coloca o que eu queria
But what I wanted was:
entrada: print 'hello world'
saída: hello world
Can someone explain to me what’s going on?
Possible duplicate of Parameters of the scanf function
– Victor Stafusa