diff options
| author | Arthur Spears <[email protected]> | 2024-04-20 11:05:46 -0700 |
|---|---|---|
| committer | Arthur Spears <[email protected]> | 2024-04-20 11:05:46 -0700 |
| commit | 618d163b5539b6a5e2f6c9ffb3f256d4f09a1e3b (patch) | |
| tree | cebf8ee2c18c8e0aa4cf5fc4630a8005164b068d | |
| parent | Added second unit tests project as example. (diff) | |
| download | homework-1-arthurtspears-feature/unit_tests.tar.xz homework-1-arthurtspears-feature/unit_tests.zip | |
Bring up to date for mergefeature/unit_tests
| -rw-r--r-- | CST 126/CST_126.sln | 10 | ||||
| -rw-r--r-- | CST 126/Homework 1/main.cpp | 27 |
2 files changed, 1 insertions, 36 deletions
diff --git a/CST 126/CST_126.sln b/CST 126/CST_126.sln index 40e5078..5a023a6 100644 --- a/CST 126/CST_126.sln +++ b/CST 126/CST_126.sln @@ -7,8 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Homework 1", "Homework 1\Ho EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Unit_Tests", "Unit_Tests\Unit_Tests.vcxproj", "{068234CA-94BA-4478-96CD-ED417EEC37F7}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTest2", "UnitTest2\UnitTest2.vcxproj", "{2F2D24BD-03B5-4299-A2A2-D64E80A12630}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -33,14 +31,6 @@ Global {068234CA-94BA-4478-96CD-ED417EEC37F7}.Release|x64.Build.0 = Release|x64 {068234CA-94BA-4478-96CD-ED417EEC37F7}.Release|x86.ActiveCfg = Release|Win32 {068234CA-94BA-4478-96CD-ED417EEC37F7}.Release|x86.Build.0 = Release|Win32 - {2F2D24BD-03B5-4299-A2A2-D64E80A12630}.Debug|x64.ActiveCfg = Debug|x64 - {2F2D24BD-03B5-4299-A2A2-D64E80A12630}.Debug|x64.Build.0 = Debug|x64 - {2F2D24BD-03B5-4299-A2A2-D64E80A12630}.Debug|x86.ActiveCfg = Debug|Win32 - {2F2D24BD-03B5-4299-A2A2-D64E80A12630}.Debug|x86.Build.0 = Debug|Win32 - {2F2D24BD-03B5-4299-A2A2-D64E80A12630}.Release|x64.ActiveCfg = Release|x64 - {2F2D24BD-03B5-4299-A2A2-D64E80A12630}.Release|x64.Build.0 = Release|x64 - {2F2D24BD-03B5-4299-A2A2-D64E80A12630}.Release|x86.ActiveCfg = Release|Win32 - {2F2D24BD-03B5-4299-A2A2-D64E80A12630}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CST 126/Homework 1/main.cpp b/CST 126/Homework 1/main.cpp index f61633a..e223d37 100644 --- a/CST 126/Homework 1/main.cpp +++ b/CST 126/Homework 1/main.cpp @@ -58,31 +58,6 @@ union FloatIntUnion }; int main() { - - /*FloatIntUnion floatIntUnion {}; - floatIntUnion.intFloat = 1.2345f; - - std::cout << "Float: " << floatIntUnion.intFloat << std::endl; - std::cout << "Binary representation: " << std::bitset<32>(static_cast<uint32_t>(floatIntUnion.intFloat)) << std::endl; - std::cout << "As Int: " << floatIntUnion.uInt << std::endl; - std::cout << "Binary representation: " << std::bitset<32>(floatIntUnion.uInt) << std::endl;*/ - int input; - cout << "How big you want your array? "; - cin >> input; - - - int* intArray = nullptr; - - try { - intArray = new int[input] {}; - } - catch (const std::bad_alloc& ex) { - delete[] intArray; - intArray = nullptr; - std::cerr << "Exception allocating memor for int array:" << ex.what(); - } - - delete[] intArray; - + return 0; } |