Thursday, July 5, 2012

Y2K Problem + Day_of_week game! C-GNU/Linux

Hi geeks.. There we can find some of our friends who can find the Day-of-Week just with the date in few counts..! That's interesting game you know ? We can do that game as a program.. Yes we can..

Working with big endian data


A have always favored little endian number representation over big-endian, which why I was saddened whn I found that TCP/IP, and most internet protocols (such as SSL3) use a big endian representation for numbers. Following is the type of construct I use when I need to work with a non-native data type in structs that I pull off of the network.

Playing with the C stack


Parameters on the stack appear in memory with the leftmost item at the lowest memory location. Thus you can get a pointer to your functions stack frame, and walk the parameter list, or even cast your stackframe to a struct that can be passed to other functions.