Monday, February 22, 2010

need help for tab_key

i find that when you insert '\t' in a string. it inserts 4 ' ' forward. But we write the bio library we can not control cursor to pass '\t' character.So can anyone teach me how to move cursor to pass '\t'?

Sunday, February 14, 2010

reiview for pointer and pointer to function

different type of pointer.
a) int a; // An integer
  b) int *a; // A pointer to an integer
  c) int **a; // A pointer to a pointer to an integer
  d) int a[10]; // An array of 10 integers
  e) int *a[10]; // An array of 10 pointers to integers
  f) int (*a)[10]; // A pointer to an array of 10 integers
  g) int (*a)(int); // A pointer to a function a that takes an integer argument and returns an integer
  h) int (*a[10])(int); // An array of 10 pointers to functions that take an integer argument and return an integer

Monday, February 1, 2010

pointer arithmentic

a[99]={.....}
short int* p = a;
short int** q = &p;

p++;//this means that pointer position increase one so that a[0] become a[1]
(*p)++;//this means that the value the pointer is pointing to increase one.


(*q)++;//means pointer p add 1 position so a[1] move to a[2]

(**q)++//means value of pointer q pointing to add one so the value the pointer p point to add 1