Starting ANSI C++ 03
This commit is contained in:
parent
e047f45a4b
commit
66672ff1c3
13
cpp/ANSI/W1/Day1/1.1/Makefile
Normal file
13
cpp/ANSI/W1/Day1/1.1/Makefile
Normal file
@ -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
|
||||
7
cpp/ANSI/W1/Day1/1.1/main.cpp
Normal file
7
cpp/ANSI/W1/Day1/1.1/main.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello World!\n";
|
||||
return 0;
|
||||
}
|
||||
13
cpp/ANSI/W1/Day1/1.2/Makefile
Normal file
13
cpp/ANSI/W1/Day1/1.2/Makefile
Normal file
@ -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
|
||||
6
cpp/ANSI/W1/Day1/1.2/main.cpp
Normal file
6
cpp/ANSI/W1/Day1/1.2/main.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello World!\n";
|
||||
return 0;
|
||||
15
cpp/ANSI/W1/Day1/Quiz/quiz.txt
Normal file
15
cpp/ANSI/W1/Day1/Quiz/quiz.txt
Normal file
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user