0

i have function on C

int myFunction(Room* room, char** buffer) {

    int l1;
    l1 = strlen(*buffer);
.
.
.
    return l1
}

And after compile with gcc i get a warning on line l1 = strlen(*buffer);:

warning: incompatible implicit declaration of built-in function 'strlen' [enabled by default]

What is is? How can i solve it?

staigoun
  • 75
  • 1
  • 7

1 Answers1

2

Include the correct header at the top of your source file:

#include <string.h>

To call a function you need to have a declaration for this function. strlen function declaration is in string.h standard header.

ouah
  • 142,963
  • 15
  • 272
  • 331