Initial commit + ex00
This commit is contained in:
commit
88000678bc
16
.vscode/c_cpp_properties.json
vendored
Normal file
16
.vscode/c_cpp_properties.json
vendored
Normal file
@ -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
|
||||
}
|
||||
20
common.mk
Normal file
20
common.mk
Normal file
@ -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
|
||||
18
ex00/Makefile
Normal file
18
ex00/Makefile
Normal file
@ -0,0 +1,18 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# :::::::: #
|
||||
# Makefile :+: :+: #
|
||||
# +:+ #
|
||||
# By: whaffman <whaffman@student.codam.nl> +#+ #
|
||||
# +#+ #
|
||||
# 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
|
||||
|
||||
BIN
ex00/Megaphone
Executable file
BIN
ex00/Megaphone
Executable file
Binary file not shown.
38
ex00/megaphone.cpp
Normal file
38
ex00/megaphone.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* :::::::: */
|
||||
/* megaphone.cpp :+: :+: */
|
||||
/* +:+ */
|
||||
/* By: whaffman <whaffman@student.codam.nl> +#+ */
|
||||
/* +#+ */
|
||||
/* Created: 2025/03/19 16:52:26 by whaffman #+# #+# */
|
||||
/* Updated: 2025/03/19 18:16:03 by whaffman ######## odam.nl */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <iostream>
|
||||
#include <cctype>
|
||||
|
||||
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;
|
||||
}
|
||||
BIN
ex00/megaphone.o
Normal file
BIN
ex00/megaphone.o
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user