can someone explain to me this code and what the output should look like?, is there going to be two strings? and what does dest[I]=to src[] mean, is string bar going to have the string abcd or efghijk.
#include <stdio.h>
void copy_str(char *dest, const char *src);
int main(void)
{
char foo[7];
char bar[7] = {'E', 'F', 'G', 'H', 'I', 'J', 'K'};
copy_str(bar, "ABCD");
copy_str(foo, bar);
return 0;
}
void copy_str(char *dest, const char *src)
{
int i;
for (i = 0; src[i] != '\0'; i++)
dest[i] = src[i];
// point one
dest[i] = '\0';
return;
}