#include <stdio.h>
int main()
{
char *str[] = {"welcome", "to", "fortemedia", "nanjing"};
char **p = str + 1;
str[0] = ( *p++ ) + 2;
str[1] = * ( p + 1 );
str[2] = p[1] + 3;
str[3] = p[0] + ( str[2] - str[1] );
printf ( "%s\n", str[0] );
printf ( "%s\n", str[1] );
printf ( "%s\n", str[2] );
printf ( "%s\n", str[3] );
return 0;
}//这种风格是ansi
#include <stdio.h>
int main() {
char *str[] = {"welcome", "to", "fortemedia", "nanjing"};
char **p = str + 1;
str[0] = ( *p++ ) + 2;
str[1] = * ( p + 1 );
str[2] = p[1] + 3;
str[3] = p[0] + ( str[2] - str[1] );
printf ( "%s\n", str[0] );
printf ( "%s\n", str[1] );
printf ( "%s\n", str[2] );
printf ( "%s\n", str[3] );
return 0;
}//这种风格叫K&R
#include <stdio.h>
int main()
{
char *str[] = {"welcome", "to", "fortemedia", "nanjing"};
char **p = str + 1;
str[0] = ( *p++ ) + 2;
str[1] = * ( p + 1 );
str[2] = p[1] + 3;
str[3] = p[0] + ( str[2] - str[1] );
printf ( "%s\n", str[0] );
printf ( "%s\n", str[1] );
printf ( "%s\n", str[2] );
printf ( "%s\n", str[3] );
return 0;
}//这种风格叫gnu
#include <stdio.h>
int main()
{
char *str[] = {"welcome", "to", "fortemedia", "nanjing"};
char **p = str + 1;
str[0] = ( *p++ ) + 2;
str[1] = * ( p + 1 );
str[2] = p[1] + 3;
str[3] = p[0] + ( str[2] - str[1] );
printf ( "%s\n", str[0] );
printf ( "%s\n", str[1] );
printf ( "%s\n", str[2] );
printf ( "%s\n", str[3] );
return 0;
}//这种风格叫linux
//参见astyle , 选那种风格,都一样,和你项目组保持一致就行。