1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-11-09 22:08:58 +01:00
programming-challenges/challenges/prefix-suffix/solutions/c/function/solution.c

19 lines
433 B
C

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include "input.h"
#include "string.h"
int main() {
char* string = input();
char* string2 = input();
bool is_preffix = string_starts_with(string, string2);
bool is_suffix = string_ends_with(string, string2);
free(string);
free(string2);
printf("%s\n", is_preffix ? "true" : "false");
printf("%s\n", is_suffix ? "true" : "false");
return EXIT_SUCCESS;
}