diff --git a/cpp/ANSI/W1/Day1/1.1/Makefile b/cpp/ANSI/W1/Day1/1.1/Makefile new file mode 100644 index 0000000..398073c --- /dev/null +++ b/cpp/ANSI/W1/Day1/1.1/Makefile @@ -0,0 +1,13 @@ +CFLAGS = -std=c++03 -O2 +LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi + +1.1: main.cpp + c++ $(CFLAGS) -o helloworld main.cpp $(LDFLAGS) + +.PHONY: test clean + +test: helloworld + ./helloworld + +clean: + rm -f helloworld diff --git a/cpp/ANSI/W1/Day1/1.1/main.cpp b/cpp/ANSI/W1/Day1/1.1/main.cpp new file mode 100644 index 0000000..e52a3fb --- /dev/null +++ b/cpp/ANSI/W1/Day1/1.1/main.cpp @@ -0,0 +1,7 @@ +#include + +int main() +{ + std::cout << "Hello World!\n"; + return 0; +} \ No newline at end of file diff --git a/cpp/ANSI/W1/Day1/1.2/Makefile b/cpp/ANSI/W1/Day1/1.2/Makefile new file mode 100644 index 0000000..d18b29e --- /dev/null +++ b/cpp/ANSI/W1/Day1/1.2/Makefile @@ -0,0 +1,13 @@ +CFLAGS = -std=c++03 -O2 +LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi + +1.1: main.cpp + g++ $(CFLAGS) -o error main.cpp $(LDFLAGS) + +.PHONY: test clean + +test: helloworld + ./helloworld + +clean: + rm -f helloworld diff --git a/cpp/ANSI/W1/Day1/1.2/main.cpp b/cpp/ANSI/W1/Day1/1.2/main.cpp new file mode 100644 index 0000000..2a68214 --- /dev/null +++ b/cpp/ANSI/W1/Day1/1.2/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() +{ + std::cout << "Hello World!\n"; + return 0; diff --git a/cpp/ANSI/W1/Day1/Quiz/quiz.txt b/cpp/ANSI/W1/Day1/Quiz/quiz.txt new file mode 100644 index 0000000..3cad94e --- /dev/null +++ b/cpp/ANSI/W1/Day1/Quiz/quiz.txt @@ -0,0 +1,15 @@ +1. What is the difference between an interpreter and a compiler? +Interpreters are Just-in-time compilers that do not make binaries. They can be edited like editing a script. Where as a compiler makes binaries that can't be changed without changing the source code and recompiling. + +2. How do you compile the source code with your compiler? +I create a Makefile - that runs the command ```g++ -o PROJECT main.cpp``` creating a binary with the PROJECT name. + +3. What does the linker do? +The linker uses the local system libraries (Nix, Windows) to make system calls to the CPU. + +4. What are the steps in the normal development cycle? +a) brainstorm +b) roadmap +c) code +d) debug +e) publish \ No newline at end of file