OK, so we implemented a linked list in C. Or so we think. We wrote a lot of code that we compiled for errors as we wrote it. However, we can't know for certain until we test it. We need to test it thoroughly and get all the results we expect. The testing and verification part of programming is just as important – sometimes even more important – than just writing code that compiles. Writing and verifying the code you write distinguishes a novice programmer from an expert.
Before we can continue, we need two functions specific to our ListData type. The first is as follows:
void PrintInt( int* i ) {
printf( "%2d ", *i );
}
The second is as follows:
ListData* CreateData( ListData d ) {
ListData* pD = (ListData*)calloc( 1 , sizeof( ListData ) );
if( pD == NULL )OutOfStorage();
*pD = d;
return pD;
}
The PrintInt()function simply prints the integer value passed to it by calling...