#include <stdio.h>
int main()
{
char s[] = "churchgate: no church no gate";
char t[25];
char *ss, *tt;
ss = s;
while (*ss != '\0')
*tt++ = *ss++;
printf("%s\n", t);
return 0;
}
what is the problem with this code? when I try to run it. Its showing up some garbage values.
static_assert(sizeof(s) <= 25, "Bad bad bad.");char t[sizeof(s)];instead. Especially, taking into account it'sc-tagged.