diff --git a/examples/debug-information/Makefile b/examples/debug-information/Makefile new file mode 100644 index 0000000..7c407bb --- /dev/null +++ b/examples/debug-information/Makefile @@ -0,0 +1,15 @@ +# Variables +CC = g++ +CFLAGS = -Wall -g +TARGET = exe +SRC = debug.cc + +# Default rule +all: $(TARGET) + +$(TARGET): $(SRC) + $(CC) $(CFLAGS) -o $@ $< + +.PHONY: clean +clean: + rm -f $(TARGET) \ No newline at end of file diff --git a/examples/debug-information/debug.cc b/examples/debug-information/debug.cc new file mode 100644 index 0000000..5e700a7 --- /dev/null +++ b/examples/debug-information/debug.cc @@ -0,0 +1,19 @@ +#include + +typedef struct Input { + int x; + int y; +} Input; + +int product(Input input) { + int result = input.x * input.y; + return result; +} + +int main() { + int a = 5; + int b = 3; + int result = product({a, b}); + std::cout << "The product is: " << result << std::endl; + return 0; +} \ No newline at end of file