I'm working on a C assignment that's basically making our own C String class. My partner and I are confident that we have the logic correct and our source files are compiling, but we're unable to get any output on a simple main file.
Our strcpy is as follows:
...
char *my_strcpy(char *s1, const char *s2)
{
int r=0;
for (int i=0;s2[i]!='\0'; i++)
{
s1[i]=s2[i];
r++;
}
s1[r+1]='\0';
return s1;
}
...
as for our main file we have:
...
const char *hello = "Hello World! ";
char pointer[1024];
my_strcpy(pointer, hello);
printf("%s\n", pointer);
...
any help would be greatly appreciated! thanks!