aboutsummaryrefslogtreecommitdiff
path: root/CST 126/Homework 1/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST 126/Homework 1/main.cpp')
-rw-r--r--CST 126/Homework 1/main.cpp84
1 files changed, 48 insertions, 36 deletions
diff --git a/CST 126/Homework 1/main.cpp b/CST 126/Homework 1/main.cpp
index e223d37..57c1541 100644
--- a/CST 126/Homework 1/main.cpp
+++ b/CST 126/Homework 1/main.cpp
@@ -8,56 +8,68 @@
#include "menu.hpp"
#include <bitset>
+#include "CST126_Structures.hpp"
+
using std::cout;
using std::endl;
-struct DailyTemperature
+uLLong MAX_LENGTH = 101;
+
+struct Array
{
- int highTemp{};
- int lowTemp{};
+ Array()
+ {
+
+ }
};
-enum DayOfTheWeek
+void CharArrays()
{
- Sunday = 0,
- Monday,
- Tuesday,
- Wednesday,
- Thursday,
- Friday,
- Saturday = 6
-};
+ char* inputChar = PromptInputNewCharArray("Input a string: ", MAX_LENGTH);
+ cout << inputChar;
+ delete[] inputChar;
+}
-enum Month
+void Strings()
{
- January = 1,
- February,
- March,
- April,
- May,
- June,
- July,
- August,
- September,
- October,
- November,
- December
-};
+ std::string myString = "Hello", mySecondString = " World";
+ std::string thirdString = myString + mySecondString;
+ cout << thirdString;
+
+ myString = PromptInputString("Input a new string: ");
+ cout << myString;
+}
-struct Date
+void WriteToFileExample()
{
- Month month;
- uint8_t day;
- uint16_t year;
-};
+ char* outputToFile = PromptInputNewCharArray("Input to file:", MAX_LENGTH);
-union FloatIntUnion
+ if (WriteToFile("new_text.txt", outputToFile))
+ {
+ cout << "Write to file successful";
+ }
+}
+
+void ReadFromFileExample()
{
- float intFloat;
- uint32_t uInt;
-};
+ if(ReadFromFileToConsole("new_text.txt"))
+ {
+ cout << "File read successfully" << endl;
+ }
+}
-int main() {
+int main(int argc, char* argv[]) {
+
+ int a = 5, b = 10;
+ bool condition = (a + b) < 15 && b > a;
+
+ // Print the number of command line arguments
+ cout << "Number of arguments: " << argc << endl;
+
+ // Loop through each argument
+ for (int i = 0; i < argc; ++i) {
+ cout << "Argument " << i << ": " << argv[i] << endl;
+ }
return 0;
}