#if !defined(my_int_t) typedef int __my_int_t; # define my_int_t __myint_t #endif
#if defined(my_int_t) my_int_t value; #else signed int value; #endif
#if !defined(my_interface_t) typedef struct my_interface_ts { int m_member_value; }__my_interface_t; # define my_interface_t __my_interface_t #endif
#if !defined(my_interface_t) # pragma pack(push,8) typedef struct my_interface_ts { int m_member_value; }__my_interface_t; # define my_interface_t __my_interface_t # pragma pack(pop) #endif
int g_argc; int main(int_s_argc, char **s_argv) { g_argc = s_argc; }
int main(void) { int s_exit_code = EXIT_SUCCESS; return(s_exit_code); }
int main(void) { static char sg_welcome[] = {"Hello world"}; (void)fprintf(stdout, "%s", (char *)(&sg_welcome[0])); return(EXIT_SUCCESS); }
int main(void) { const int c_exit_code = EXIT_SUCCESS; static char cg_welcome[] = {"Hello world"}; (void)fprintf(stdout, "%s", (const char *)(&cg_welcome[0])); return(c_exit_code); }
#define __def_default_private_key (0x12345678) static int __g_private_key = __def_default_private_key;
int io_control(int s_ioport) { if(s_ioport == (-1)) { goto l_return; } /* ... */ l_return:; return(0); }
#define def_default_buffer_size (32 << 10)
/* 모듈명이 "mzapi"라고 한다면 */ void mzapi_hello_world(void) { (void)fprintf(stdout, "Hello world\n"); }
int example_puts(const char *s_string) { return(fprintf(stdout, "%s", s_string)); } int main(void) { char const c_const_string[] = {"Hello world !\n"}; (void)example_puts((const char *)(&c_const_string[0])); return(0); }
/* header.h */ extern int example_info(void); /* 함수의 외부참조 선언 */ /* source.h */ int example_info(void); /* 함수의 프로토타입 선언 */ int example_info(void) { /* ... */ return(0); }
void my_function(void) { /* open */ } /* close */
if (my_expression == 0) { /* open */ } /* close */ for(;;) { } do { }while(0); switch (case) { case: break; default: break; }
/* 이 예제의 경우 함수내에서 포인터의 변형이 일어나지는 않지만 반환받는 곳에서는 const로 받지 않는 경우를 제시한것이다. */ char *never_null_string(const char *s_string, const char *s_default_string) { union { char *m_string; const char *m_const_string; }s_complex_string; if(s_string == ((const char *)0)) { s_complex_string.m_const_string = s_default_string; } else { s_complex_string.m_const_string = s_string; } return(s_complex_string.m_string); }