cst 334: Week1

 Week 1:

    This week's learning was primarily composed of doing assignment PA1, supplemented by browsing stack overflow and asking chat gpt questions. The most interesting to me was the code-shock after returning to C after never having touched it. C++ forms the basis of most of the coding concepts I know, but C takes it a drastic step further with the memory allocation control. Doing assignment PA1 taught me a lot about how to think about string structs and how to allocate the memory that they need when conducting string manipulations. Manually having to shift characters, and updating capacities made me yearn for and appreciate the simplicity of python. 
    

Near the end of PA1, I found memmove on stack overflow. This enabled me the luxury of not having to use a for loop to manually move characters to the right or left, instead it allowed me to shift many characters to the desired position in the string. Similarly, I discovered memcpy which allowed me to mimic concatenation, thus saving me from a for loop of manually inputting characters. It copies the desired string to your desired location with ease.  So after shifting the characters at a specific index over x spaces, with memmove, I was able to use memcpy to implant another string in between those characters. 


    This was a good introduction to the course. I got a lot out of the lectures as well. They made completing the assignment, lab, and quizzes relatively easy. I'm not looking forward to thumbing through the textbook, but it looks like it’ll be necessary to supplement my learning in the long term. I’m looking forward to week 2. 

Comments

Popular Posts