Entries Tagged ‘c’:

ADTs : Stacks

As an exercise, i will design and implement my own stack ADT. First of all we need to build necessary structures. The Head structure will contain a counter and a pointer to stack nodes. The node structure will contain a data pointer and a node pointer. typedef struct node2 { void *dataPtr; struct node2 *nodePtr; [...]

Tags: , ,

Leave a Comment

Char to Int Conversion in C

The programming thing has a lot of tricks and as a programmer, I like them very very much. The latest trick that i have come across is converting a char digit to its integer value. As you know, if you write something like this: char num[11] = “0123456789″; int s = (int)num[0]; printf(“%d\n”,s); It will [...]

Tags: , ,

Comments (1)