strcmp or string::compare?

后端 未结 6 2167
北荒
北荒 2020-12-03 11:28

I want to compare two strings. Is it possible with strcmp? (I tried and it does not seem to work). Is string::compare a solution?

Other tha

6条回答
  •  忘掉有多难
    2020-12-03 12:15

    When using C++ use C++ functions viz. string::compare. When using C and you are forced to use char* for string, use strcmp

提交回复
热议问题