Skip to content
Snippets Groups Projects
Select Git revision
  • c255da4dd56398b3a641abfdf659d7da19bd5373
  • 2024ws default
  • 2023ws
  • 2022ws
  • 2021ws
  • 2020ws
  • 2018ws
  • 2019ws
  • 2017ws
  • 2016ws
10 results

string-ops-7.c

Blame
  • string-ops-7.c 466 B
    #include <stdio.h>
    #include <string.h>
    
    int main (void)
    {
      char *anton = "Anton";
      char *zacharias = "Zacharias";
    
      printf ("%d\n", strcmp (anton, zacharias));
      printf ("%d\n", strcmp (zacharias, anton));
      printf ("%d\n", strcmp (anton, anton));
    
      char anton2[] = "Anton";
      if (anton == anton2)
        printf ("gleich\n");
      else
        printf ("ungleich\n");
    /*
      char buffer[100] = "Huber ";
      strcat (buffer, anton);
      printf ("%s\n", buffer);
    */
    
      return 0;
    }