0

I'm having trouble with a "re-made" function that I've built in C.

I've rebuilt strlen and strncat from the string.h library (for educational purposes) and it does compile, but immediately crashes. In addition, there's a warning saying that strncat already exists, even though I did not include the header file.

And yes, I've used the same name.

How can this be? How can I fix this?

tl;dr rebuilt a c function from , and even though I didn't include it, it still thinks it already exists

yeho
  • 132
  • 2
  • 13
  • 1
    There's no way we can know what you did wrong if you don't show us your code. Please update your question with a [mcve]. Also, don't name your functions the same as library functions. Give them a different name. – dbush Feb 03 '20 at 20:19
  • 1
    The command you're using to compile/link would also be relevant here. – Reticulated Spline Feb 03 '20 at 20:20
  • 1
    The C library is linked into your executable by default (removing that is possible but then you have to re-implement a bunch of stuff). The linked question has better alternatives. – Mat Feb 03 '20 at 20:23
  • Thank you! I'll just change the name. – yeho Feb 03 '20 at 20:39

0 Answers0