fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main(void) {
  4. //char* str1 = "abc";
  5. //char* str2 = "abc";
  6.  
  7. char str1[]={'h','e','r','e',0};
  8. char* str2="here";
  9. if (strcmp(str1, str2) == 0) {
  10. printf("str1和str2相同!\n");
  11. }
  12. else {
  13. printf("str1和str2不相同!\n");
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 4400KB
stdin
Standard input is empty
stdout
str1和str2相同!