From 377494c5138c38eb1fddfb8595457e04fc9937d3 Mon Sep 17 00:00:00 2001 From: Christopher Qiu Date: Wed, 29 Jan 2025 17:24:52 -0500 Subject: [PATCH] a --- programming_pointers/.gitignore | 1 + .../.launches/programming_pointers.launch | 16 ++++++++++++++++ programming_pointers/pointer_example_main.c | 2 +- programming_structs/.gitignore | 1 + .../.launches/programming_structs.launch | 16 ++++++++++++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 programming_pointers/.gitignore create mode 100644 programming_pointers/.launches/programming_pointers.launch create mode 100644 programming_structs/.gitignore create mode 100644 programming_structs/.launches/programming_structs.launch diff --git a/programming_pointers/.gitignore b/programming_pointers/.gitignore new file mode 100644 index 0000000..3df573f --- /dev/null +++ b/programming_pointers/.gitignore @@ -0,0 +1 @@ +/Debug/ diff --git a/programming_pointers/.launches/programming_pointers.launch b/programming_pointers/.launches/programming_pointers.launch new file mode 100644 index 0000000..3d0d541 --- /dev/null +++ b/programming_pointers/.launches/programming_pointers.launch @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/programming_pointers/pointer_example_main.c b/programming_pointers/pointer_example_main.c index b7e4c6f..88fa653 100644 --- a/programming_pointers/pointer_example_main.c +++ b/programming_pointers/pointer_example_main.c @@ -80,7 +80,7 @@ int main(void) // Example 4: having fun with pointers and arithmetic operations on them // You can also learn about Big-endian little-endian. Read about it here: https://en.wikipedia.org/wiki/Endianness Which one is MSP432? Big or little endian? unsigned int N = 0x11223344; - unsigned char *Nptr = &N; //There will be a warning here. Why? + unsigned char *Nptr = (unsigned char *)&N; //There will be a warning here. Why? printf("%02x\n",*Nptr); for (i = 0; i<4; i++) diff --git a/programming_structs/.gitignore b/programming_structs/.gitignore new file mode 100644 index 0000000..3df573f --- /dev/null +++ b/programming_structs/.gitignore @@ -0,0 +1 @@ +/Debug/ diff --git a/programming_structs/.launches/programming_structs.launch b/programming_structs/.launches/programming_structs.launch new file mode 100644 index 0000000..eceeb03 --- /dev/null +++ b/programming_structs/.launches/programming_structs.launch @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + +