From adb2e8983f9919972e7bf75b99efbaf6f78957cc Mon Sep 17 00:00:00 2001 From: "mijo.cikes" Date: Tue, 13 Nov 2018 16:16:42 +0100 Subject: [PATCH] day 1 --- exercise/01/app/app/app.cpp | Bin 0 -> 3086 bytes exercise/01/app/app/app.vcxproj | 171 +++++++++++++++++++++++++ exercise/01/app/app/pch.cpp | Bin 0 -> 426 bytes exercise/01/app/app/pch.h | Bin 0 -> 1262 bytes exercise/01/e01.sln | 25 ++-- exercise/01/lib/static_library.vcxproj | 1 + exercise/02/code.cpp | 13 ++ exercise/02/code.h | 2 + exercise/02/test1.cpp | 6 +- 9 files changed, 200 insertions(+), 18 deletions(-) create mode 100644 exercise/01/app/app/app.cpp create mode 100644 exercise/01/app/app/app.vcxproj create mode 100644 exercise/01/app/app/pch.cpp create mode 100644 exercise/01/app/app/pch.h diff --git a/exercise/01/app/app/app.cpp b/exercise/01/app/app/app.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0e32d0641fabf31c33114db44b600d70d8f98356 GIT binary patch literal 3086 zcmbVOYfn=_5S_0z@jtBf14T_6P>8`wVw55YiUEutn{s<8HKiqe@QCrRtLMygy6x>! zh-voT+ueDbIXk;EfB)2^CP7+qglP!E$xJH98D=^&+b!5=t0dpi+YnM! zc`8qUy{7Nys*?fb1d_xPq>NZHpsQk(?~$U+1YUd4&mNGhV!ejJXB!$l*~Hgl_3Lt@ z7~A0B2C)#;?mejLkQ_i}46brz%OtNc+f_y;Sk0w5#jzn3Syx-X^jU)D9gyY9#W}d3 zSBo=;>l|i`;+m-GtV>Ocm?owLIss3tR!(&kDZQF-vyF z@I8c0N7#@La*SL%2F{O=u~-b*zRFu3W{_*+M;jyjDh2zmpj%Gxl)~nGF(XUjdr(Sf zFSAU9jF8L`i!q+#`%3?FmohNMY^XoV;x1xwM9xY{_1ietJFv!F7{gy3zjTz#IGJIK zj5E8a?RFSPMc%5MSte%lnPZ2zw~pucG@lw8W4@Fti+SbwXIfQM54T&&k8FrL?%`shGFtPT8uMQ#SuM zPVSv$c$n3TVpM*&rTkLX_sQjKPwWm%uUS^uTI8HqIIIF5BTxF+F`l|urC0|)Vi$(U z-5@V98nT7w05bviV2&GZ0(JxL@*pR=XG1)L{6L(njegdmtkpN_TtdGO{fHt;rI0+< zceIlB75$w8 zJoVHIZ?~{e52a!~IWTi1(V>Jg_c4w|r^s%Kr_F>N>v5NW=I>sQ+f>qZbU#IpC;4=q$*U4a? z`^4FRTr;oaxvewabB=_S*s!ni!@ai1Jada4*^^i|S(Hq9b)4Sc+P&a0E}nsHW#mBb z50_^*WxYwR5m + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {2E05B316-3517-4AAB-A15D-5B53A24CF1EE} + Win32Proj + app + 10.0.17134.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + ..\..\lib\;%(AdditionalIncludeDirectories) + + + Console + true + static_library.lib;dynamic_library_with_implib.lib;%(AdditionalDependencies) + ..\..\dll2\$(Platform)\$(Configuration)\;..\..\lib\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/exercise/01/app/app/pch.cpp b/exercise/01/app/app/pch.cpp new file mode 100644 index 0000000000000000000000000000000000000000..135cedc6e202f1f6f6d0fd2aebfcb9eb5a88f3fe GIT binary patch literal 426 zcma)(O%8%U429p?#5)k(s_gXy9s`F#hzNwA1(#R9mJs94Oc>hN_Vu;%ex*v4s8dj> z6L-fsgA8glsRxO8g(}r<1@N8|$>^{f<-{7@$r|yE%c4grTRriX%A80Eo{=BPxZpQf z#y@Z}uo!5 zY>)Yt7?F2lcmBR1+QK#-XGNr7XZ8fr!cn3lZ5^Y)vUSfD^AwDN*h^Lw&)lPx++47# zd)SAA*b{C}iSS;`84M~$v>AMrgP7FJ8+gu~LAukhS6*EOJ`b`OdG>3c0~t!sZmv>H zn*HLA@+(*ivq2}#QbRtnCS6sZB|bGHY13EaXpqYpyv1DpS76m1eTdT|r_t-78YQ1T z#<62u5HD*r_L~oQCI!E8@(t$Ve*GNp63pmTN&3$4QJrKBuD-fJIu~wfYrcy;aeoU( z{gpDyo!duDy%mVwzd3}ObITpQ?&R3*fD>2bk}TRUp!6E5gQ6*el=X_*#+Q5I8?Z>{ zRy|dAN-mZA&0pz!j#b}5FeyBGiKSg%o7_9|!S#V|#ttsxpDyDUbdaS$838ttrue _DEBUG;_LIB;%(PreprocessorDefinitions) true + \..\lib\($Platform)\($Configuration)\ Windows diff --git a/exercise/02/code.cpp b/exercise/02/code.cpp index 85e778c..6128eaa 100644 --- a/exercise/02/code.cpp +++ b/exercise/02/code.cpp @@ -1,2 +1,15 @@ #include "stdafx.h" #include "code.h" +void f2(int* a1, int* a2) +{ + int diff = a2 - a1; + for (int i = 0; i < diff; i++) + *(a1 + i) = *(a1 + i) + 1; +} + +void f1(int &a, int &b) +{ + int t = a; + a = b; + b = t; +} diff --git a/exercise/02/code.h b/exercise/02/code.h index e69de29..e3ca751 100644 --- a/exercise/02/code.h +++ b/exercise/02/code.h @@ -0,0 +1,2 @@ +void f2(int* a1, int* a2); +void f1(int &a, int &b); \ No newline at end of file diff --git a/exercise/02/test1.cpp b/exercise/02/test1.cpp index 33dfab7..29b52ae 100644 --- a/exercise/02/test1.cpp +++ b/exercise/02/test1.cpp @@ -14,14 +14,14 @@ namespace simple_test TEST_METHOD(f1_changes_values) { int a=1, b=2; - //f1(a, b); + f1(a, b); Assert::AreEqual(2, a); Assert::AreEqual(1, b); } TEST_METHOD(f2_increases_all_values_by_one) { int arr[] = { 1, 2, 3 }; - //f2(arr, arr+3); + f2(arr, arr+3); Assert::AreEqual(2, arr[0]); Assert::AreEqual(3, arr[1]); Assert::AreEqual(4, arr[2]); @@ -29,7 +29,7 @@ namespace simple_test TEST_METHOD(f2_works_for_different_number_of_values) { int arr[] = { 2, 4, 6, 8, 10 }; - //f2(arr, arr+5); + f2(arr, arr+5); Assert::AreEqual(3, arr[0]); Assert::AreEqual(5, arr[1]); Assert::AreEqual(7, arr[2]);