C comparing pointers (with chars)

前端 未结 4 1100
我在风中等你
我在风中等你 2021-01-04 08:28

Good evening, I have 2 functions and each of them accepts as argument a pointer to char:

char pointer[255];
func1(char* pointer)
{
...
memcpy(pointer,some_ch         


        
4条回答
  •  青春惊慌失措
    2021-01-04 09:07

    Use function srtncmp no srtcmp.

    int res = strncmp(str, "¿Cuál es tu nombre? ", 100);
    

    See the next link

    compare strings

提交回复
热议问题