Posts

Showing posts from December, 2018

Structure & Union

Image
In one of Algorithm Class we had, we have learnt about Structure and Union. Although we haven't learnt it more precisely or more deep. we have been thought what is structure and union.  A structure is a user-defined data type available in C that allows to combining data items of different kinds. Structures are used to represent a record.  And on the other hand, Union is  a special data type available in C that allows storing different data types in the same memory location. You can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple purposes. there are some similarities between this two, such as both are user defined data types, both are objects of any type etc. but there are a difference such as how to define structure as struct and to define union we use union , there can only be first member on union can be initialized and there can be several on stru...

Function (Recursive & Iterative)

Image
In one of Algorithm Class this last 2-3 weeks, we learnt about function. The point of learning function is basically so that programmer can make a code or simply a sub-program that we can easily call if we have to or wanted to use it. we learnt that sometimes there's a problem that may be or may not be cleared by using a function. Nonetheless we must know what kind of problem is best use using a function or by using just the usual programming method. On the other hand, we have a learnt about recursive and iterative function. Basically recursive function is a function that will call or repeat it's own function to solve a certain problem. While iterative function is creating the usual function without calling it inside the function we are creating. We learnt that we need function in a more difficult task so that we can split up the work in our teams, and to find a more efficient way in our programming to complete the task or problem