commit 88000678bc4e0041c22b6935d8e3bae517ea23ab Author: whaffman Date: Wed Mar 19 18:17:25 2025 +0100 Initial commit + ex00 diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..9e6febf --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/clang", + "cStandard": "c17", + "cppStandard": "c++14", + "intelliSenseMode": "linux-clang-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/common.mk b/common.mk new file mode 100644 index 0000000..1024c65 --- /dev/null +++ b/common.mk @@ -0,0 +1,20 @@ +OBJ = $(SRC:.cpp=.o) +CC = c++ +CFLAGS = -Wall -Wextra -Werror +all: $(NAME) + +$(NAME): $(OBJ) + $(CC) $(CFLAGS) $(OBJ) -o $(NAME) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(OBJ) + +fclean: clean + rm -f $(NAME) + +re: fclean all + +.PHONY: all clean fclean re \ No newline at end of file diff --git a/ex00/Makefile b/ex00/Makefile new file mode 100644 index 0000000..77a699f --- /dev/null +++ b/ex00/Makefile @@ -0,0 +1,18 @@ +# **************************************************************************** # +# # +# :::::::: # +# Makefile :+: :+: # +# +:+ # +# By: whaffman +#+ # +# +#+ # +# Created: 2025/03/19 16:44:48 by whaffman #+# #+# # +# Updated: 2025/03/19 16:58:04 by whaffman ######## odam.nl # +# # +# **************************************************************************** # + + +NAME = Megaphone +SRC = megaphone.cpp + +-include ../common.mk + diff --git a/ex00/Megaphone b/ex00/Megaphone new file mode 100755 index 0000000..b0a3258 Binary files /dev/null and b/ex00/Megaphone differ diff --git a/ex00/megaphone.cpp b/ex00/megaphone.cpp new file mode 100644 index 0000000..400e4bc --- /dev/null +++ b/ex00/megaphone.cpp @@ -0,0 +1,38 @@ +/* ************************************************************************** */ +/* */ +/* :::::::: */ +/* megaphone.cpp :+: :+: */ +/* +:+ */ +/* By: whaffman +#+ */ +/* +#+ */ +/* Created: 2025/03/19 16:52:26 by whaffman #+# #+# */ +/* Updated: 2025/03/19 18:16:03 by whaffman ######## odam.nl */ +/* */ +/* ************************************************************************** */ + +#include +#include + +int main(int argc, char **argv) +{ + int i; + int j; + + i = 1; + if (argc < 2) + { + std::cout << "* LOUD AND UNBEARABLE FEEDBACK NOISE *" << std::endl; + return (EXIT_SUCCESS); + } + while (i < argc) + { + j = 0; + while (argv[i][j]) + { + std::cout << (char)std::toupper(argv[i][j]); + j++; + } + i++; + } + std::cout << std::endl; +} diff --git a/ex00/megaphone.o b/ex00/megaphone.o new file mode 100644 index 0000000..d871532 Binary files /dev/null and b/ex00/megaphone.o differ