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

main-params-5.c

Blame
  • string-ops-15.c 295 B
    #include <stdio.h>
    #include <string.h>
    
    int main (void)
    {
      char buffer[100] = "";
      sprintf (buffer, "Die Antwort lautet: %d", 42);
      printf ("%s\n", buffer);
    
      char *answer = strstr (buffer, "Antwort");
      printf ("%s\n", answer);
      printf ("found at: %zd\n", answer - buffer);
    
      return 0;
    }