Tag Archives: C

passing 2D array in C – some mistakes and tips

// This is an example source file which is used to show common // mistakes and tips when passing 2D array as a parameter to a // function call in C/C++ programming. // Feb 19, 2011 // dave.tian@alcatel-lucent.com #include <stdio.h> … Continue reading

Posted in Programming | Tagged , | Leave a comment

to record my stupid mistake in programming

This post is used to record one mistake while my coding – just for my bad memory:) I have to admit that it spent me the whole day to figure out what was wrong, as it looked prefect except parse … Continue reading

Posted in Programming | Tagged | 1 Comment

write your own function with varying arguments

This post is used to tell how to write your own function with varying arguments (如何写变参函数) – we will write our own ‘printf()’ function called ‘ddLog()’. Wish the code below would give you a hint:) /* * This source file … Continue reading

Posted in Programming | Tagged | Leave a comment

state machine programming – smp

This is a little C program used to show the framework of state machine programming (smp,状态机编程). Detailed state transition picture is as below. Try to build the source code below and enjoy:) /* * State Machine Program (SMP) * This … Continue reading

Posted in Dave's Tools, Programming | Tagged , , | Leave a comment

time measurement for function call

Episode usage of ‘gettimeofday()’ and ‘times()‘ On Unix/Linux machine to measure the time consumption for certain function call, ‘gettimeofday’/’times’ would be 2 major ways. Better than ‘gettimeofday’, ‘times’ could provide detailed time info for user, system, child… 1. gettimeofday() #include … Continue reading

Posted in Programming | Tagged , , , , , | Leave a comment