Asher talks about his recent struggles with eczema, and his journey and frustrations with trying to get employment in the retail industry in his home town. He also talks about his self-defeating depressive “spells” he gets sometimes. There are some manga books thrown in, and a new friend met at a birthday party. So good times!
Asher talks about the last several weeks, discussing all the manga he’s read, the art piece he finished from Art Therapy, his new found friend, Gorehound’s Playground viewings, Christmas trees, Seth Material, and possible future employment. All in all, a very Asher time.
Asher talks about his year and all the good, and a few bad, things that happened in it, as well as going into detail about what he did for New Year’s Eve and New Years Day. There were fireworks in Old Town, which Asher caught on video, and what’s a January 1st without a Golden Girls Viewing Party!
This post talks about my absence from my blog, covering my skin condition and my mental health issues (my medication was messed with). I also post pictures of the Garden of Lights, a video of the Lady Gaga concert I attended, and my new necklace. I’m doing better now, but it was a really rough two months.
This article is a continuation on expressions that can be constructed in the C language. This article will focus on expressions involving operators. If you remember, expressions are pieces of code that are executed right away to yield some kind of result, as opposed to a statement which may affect an entire program’s structure.
By incorporating bitwise operations in its core language, C provides a way to program low level processor specific operations inside a more structured program (as compared to assembly). C lets us perform ands, ors, exclusive ors, and one’s complement operations to chars and ints.
Being able to compare the values of variables is extremely important in any C program. Later on we’ll cover how we can alter the flow of a program depending on the results of relational and logical operators, in essence creating programs or processes that can somewhat “think” for themselves. C provides an AND, OR, and NOT operators, but from these operators we can easily build any kind of more complex boolean logic operation, as we have done above with exclusive or (XOR).
C includes the basic arithmetic operators, including assignment, division, multiplication, addition, subtraction and modulus. When you operate on variables and other literals you have to be careful of your type conversions that C automatically does for you, lest you lose some of the data you are trying to protect.
In this one post I do quite a number of things that are important to advancing in Dragon Warrior. I start out in Cantlin and travel off to Hauksness. There I find and retrieve Erdrick’s Armor, which is one piece towards defeating the Dragonlord. Then I obtain Erdrick’s Token in the swamp, the Rainbow Drop south of Rimuldar, create the Rainbow Bridge and retrieve Erdrick’s Sword in Charlock Castle, the home of the Dragonlord.
What if ther was a way to name a certain type, and then use that name across your program? That way, if that particular type needed to be changed, say to be an int instead of a char, you could specify that in one place. Well, that’s where the typedef statement comes in. However, typedef’s can be a mixed bag, if used too much you acquire obfuscation in your code, but if used to little, you may end up having to edit your code in multiple places; or you may end up with code whose purpose is difficult to understand.
Enumerations allow us to specify identifiers for integer values without having to specify a long list of global variables or constants. We also covered unions, which are a bit more esoteric, but useful anyway. Sometimes we need to access an array of long ints as individual char bytes, with a union you can do that! Lastly, we rounded-up with bit-fields: a C programming built-in that allows us to identify and work with specific bits by name.
Structures are ways to encapsulate related data, presumably, under one data type. This allows us to organize data that is related to each other into one place. Otherwise, all of our data would have to exist in separate variables, and as we programmed we’d have to remember how it call connected ourselves. This is truly prone to drastic error, and memory wise is convoluted.
Literals are very important in programming, as they are one way to get data into a program. Assigning literals to variables allows us to specify a number of things such as the number of times we’re going to perform an operation. Using literals in various parts of the program allow us to specify how large an array is going to be. Using string literals we might hard-code (that’s when you put data that the program uses straight into the program code) an array of error messages that would be output when certain errors happen.
Pointers and arrays are closely related in C. Using indexes and pointers to access the contents of an array are simply two sides to the same coin. They offer two perspectives that aim towards the same goal. With pointer arithmetic (which we covered in the article on pointers), you can access each element in the array one after another or randomly. With array indexing you can specify a short hand number that is easier to understand and read but does the same thing.
Pointers at this point in the article series may seem like more of a pain that a boon, but they are very powerful when it comes to constructing articulate programs. Pointers allow us to pass the memory addresses of specific objects around in our programs, and to modify memory in various places.
Arrays give us a wealth of opportunities to creatively solve our problems, and I hope I was able to elaborate on more of their functioning in this article. They can be confusing at first, particularly multi-dimensional arrays, but they are simply sequences (of seqences of sequences…). Thanks for reading
In C variables have to be of a specific data type. Luckily, C defines only 5 basic data types that it works with, so it’s not too difficult to choose what you want. All the data types are covered in this article, including their size modifiers unsigned, signed, short and long.
I’m not personally huge on modifying or getting my IDE to do lots of bells and whistles, but simply having a central program and place to debug, test, compile, and write your code is very powerful for your productivity. Add on that basic code inspection tools, error checking, syntax highlighting, file tracking, version control, and you got yourself a tool I’d use any day.