I used scanf to see the string in terminal . I don't need to use the scanf() to see the printf() values in following code part2?
Part1:
int main ()
{
int c;
printf("hi there");
scanf ("hey %d",c);// to check the output
return(0);
}
part2:
int main ()
{
const char src[50] = "When in Rome, do as the Romans";
char dest[50];
printf("Before memcpy dest = %s\n", dest);
printf("Before memcpy src1 = %s\n", src);
memcpy (dest, src, strlen(src)+1);//copying the address
printf("After memcpy dest = %s\n", dest);
printf("Before memcpy src2 = %s\n", src);
}
Why I cannot see the output of hello world without scanf() in terminal; while I can see for multiple printf with memcpy() function?