Saturday, January 21, 2012

Pointers to Pointers

Yes you can have Pointers to Pointers in C. Since everything is passed by copy unless specified than you need to pass a pointer to a pointer for things like linked list

void foo(List **l){
*l = (*l)->next;
}

List L;
List *lP = &L;
foo(&lP);

Thursday, January 12, 2012

C

When creating functions in C you need to declare all your variables before any other function is called

void foo(){
doSomething();
var int; // BAD
}

void foo(){
var int; //GOOD
doSomething();
}

If you want to compile via command line in Windows, find the bin folder of your visual studio via command line

C:\Program Files\Microsoft Visual Studio 8\VC\bin

execute the vcvars32.bat

Now go to the folder where your program is and use CL (compile and link) followed by any files you want to make your exe

CL queue.c queueTest.c

Thursday, January 5, 2012

Tip of the day - Excel

You know how Excel does smart pasting, which will automatically increment rows as you paste? Well what if you wanted something to stay static. You can prevent the incremental behavior by prefixing the column and row with a dollar sign. The cell N12 become $N$12.

Neat!

Tuesday, January 3, 2012

In the beginning . . .

Hello and welcome to 'Learning the Digital World'. This blog is focused on all the things electronic. We will look at programming and electronics and even robotics. Their will be notable mention of game development techniques.