-
Recent Posts
Archives
- July 2016
- June 2016
- May 2016
- March 2016
- January 2016
- November 2015
- October 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- October 2013
- September 2013
- August 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- April 2011
- March 2011
- February 2011
Categories
My Tags
My Profile
Senior Software Engineer At Actuate
Meta
Tag Archives: C&C++
compiler study 5 – crowbar whole workflow
here is the full-featured markdown version : full version, which has better markdown support such as sequential graph and flow chart. I debugged the crowbar program, just have a rough idea how the crowbar works. test case 1 preparation write … Continue reading
compiler study 4 – crowbar debug and code analysis
compiler study 4 – crowbar here is the full-featured markdown version : full version, which has better markdown support such as sequential graph and flow chart. debug on mac, the gdb has been replaced with lldb, here is some debug … Continue reading
compiler study 3 – crowbar compile and interpret flow
compiler study 3 – crowbar here is the full-featured markdown version : full version, which has better markdown support such as sequential graph and flow chart. CRB_compile CRB_compile would do several things : 1. lex the source code to token … Continue reading
compiler study 2 – crowbar lex and yacc
compiler study 2 – crowbar here is the full-featured markdown version : full version, which has better markdown support such as sequential graph and flow chart. lex string.c – crb_create_identifier, allocate memory for identifier and add the memory to the … Continue reading
c pointer and mutiple dimension array
Sometimes I am still a little bit confused by the relationship between a pointer and a multiple dimensional array. Let’s see some sample code: #include <stdio.h> // void printArr( int *arr, int row, int col ){ int i, j; for( … Continue reading
a bug for visual studio 2008?
Here is a sample code, runs well in GCC, but not in visual studio 2008. #include <stdio.h>using namespace std;int main( void ){ printf( “%s\n”, “hello” );} but in visual studio 2008, I got in order to make the namespace … Continue reading
what’s the usage of header guard?
When you create header file in Code::Block, you would always see something like this : #ifndef LEFTROTATION_H_INCLUDED#define LEFTROTATION_H_INCLUDED .. #endif why these header guard should be there? Suppose you have a header file named a.h, then in multiple file, let’s … Continue reading
an segment fault issue
I always will meet some ‘segment fault’ or ‘memory is not accessible’ error when I uses pointers. some memory issue is impercitable. I have a C function like this : void swap5(char** p, char** t) { char temp = **t; … Continue reading
c constant pointer
I met a c constant pointer and it take me sometime to figure it out. Here is the code: char *leftRotation2(char *arr, int N, int K) { while(K–) { int j = arr[N-1]; for(int i=N-1;i>0;i–) { arr[i] = arr[i-1]; } … Continue reading
c double pointer usage
When I read some C code about tree, C double pointer attract my attention. void insert(node ** tree1, node * item) { 12 if(!(*tree)) { 13 *tree = item; 14 return; 15 } 16 if(item->val<(*tree)->val) 17 insert(&(*tree)->left, item); 18 else … Continue reading