diff --git a/Lab1/makefile b/Lab1/makefile index 7ad58cd..4cffdd5 100644 --- a/Lab1/makefile +++ b/Lab1/makefile @@ -14,7 +14,7 @@ all: $(EXECUTABLE) $(SOURCES) $(EXECUTABLE): $(OBJECTS) $(CC) $(LFLAGS) -o $@ $(OBJECTS) --include * .d +-include *.d %.o:%.cpp $(CC) $(CFLAGS) $< diff --git a/Lecture/Week2/main.cpp b/Lecture/Week2/main.cpp new file mode 100644 index 0000000..649c0b3 --- /dev/null +++ b/Lecture/Week2/main.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; + +int & multiply(int A, int B) { + int i = A*B; + return i; +} + +int main() { + int A = 5; + int B = 3; + int C = multiply(A,B); + cout << "A: " << A << " B: " << B << " C: " << C << endl; + + return 0; +} \ No newline at end of file diff --git a/Lecture/Week2/main2.cpp b/Lecture/Week2/main2.cpp new file mode 100644 index 0000000..d3085ed --- /dev/null +++ b/Lecture/Week2/main2.cpp @@ -0,0 +1,15 @@ +#include +using namespace std; + +int main() { + // int length; + // cin >> length; + int array1[3] = {3, 10, 40}; + cout << array1 << endl; + cout << *array1 << endl; + cout << array1 << endl; + + + + return 0; +} \ No newline at end of file