Jump to content

Question

Posted

dc? imi da erori la strcpy???

eroriile:

 warning 225: unreachable code
 error 029: invalid expression, assumed zero
 error 017: undefined symbol "strcpy"
 error 001: expected token: ",", but found "sizeof"
 fatal error 107: too many error messages on one line
liniile:
stock strcpy(dest[],src[],size = sizeof(dest))
{
        dest[0] = '\0';
        return strcat(dest,src,size);
}

2 answers to this question

Recommended Posts

Posted

Incearca:

stock strcpy(dest[], const source[], const dsize = sizeof dest, const ssize = sizeof source)
{
        if(ssize < dsize) {
                memcpy(dest, source, 0, ssize*(cellbits/8), dsize);
                dest[ssize] = '\0';
        } else {
                memcpy(dest, source, 0, (dsize-1)*(cellbits/8), dsize);
                dest[dsize-1] = '\0';
        }
}

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.