mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-05-18 12:02:53 +02:00
feat(cli): add --all
option to run test
command
This commit is contained in:
@ -9,7 +9,7 @@ void character_append(char* string, char character) {
|
||||
string[length + 1] = '\0';
|
||||
}
|
||||
|
||||
const char character_to_upper(const char character) {
|
||||
char character_to_upper(char character) {
|
||||
char ascii_a = 'a';
|
||||
char ascii_A = 'A';
|
||||
char ascii_z = 'z';
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef CHARACTER_H
|
||||
#define CHARACTER_H
|
||||
#ifndef __CHARACTER__
|
||||
#define __CHARACTER__
|
||||
|
||||
/**
|
||||
* @brief Append a character to a string, assuming string points to an array
|
||||
@ -14,8 +14,8 @@ void character_append(char* string, char character);
|
||||
* @brief Converts the character to uppercase.
|
||||
*
|
||||
* @param character
|
||||
* @return const char
|
||||
* @return char
|
||||
*/
|
||||
const char character_to_upper(const char character);
|
||||
char character_to_upper(char character);
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "input.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "character.h"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
#ifndef __INPUT__
|
||||
#define __INPUT__
|
||||
|
||||
/**
|
||||
* @brief Read a line from stdin.
|
||||
|
@ -18,7 +18,7 @@ char* string_to_upper(const char* string) {
|
||||
char* string_reverse(const char* string) {
|
||||
size_t string_length = strlen(string);
|
||||
char* result = malloc(sizeof(char) * (string_length + 1));
|
||||
for (size_t index = string_length - 1; index != -1; index--) {
|
||||
for (int index = string_length - 1; index != -1; index--) {
|
||||
character_append(result, string[index]);
|
||||
}
|
||||
return result;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
#ifndef __STRING__
|
||||
#define __STRING__
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
|
Reference in New Issue
Block a user