TOP Computer Languages GCC C++
# | 文字列化 | #define STRING(str) #str | strを""で囲む | STRING(abc) -> "abc" |
## | Token連結 | #define VAR(id) var##id | var1, var2 などの変数名を生成 | VAR(1)->var1 |
typedef struct aa2 {
unsigned short o;
unsigned short s;
unsigned short r:5;
unsigned short t:8;
unsigned short d:2;
unsigned short p:1;
unsigned short h;
}__attribute__ *1 aa;
unsigned short o;
unsigned short s;
unsigned short r:5;
unsigned short t:8;
unsigned short d:2;
unsigned short p:1;
unsigned short h;
}__attribute__ *1 aa;
/*
* this pair won't work -- error: parse error before "B"
typedef struct A_tag{
B * bb;
int i;
}A;
typedef struct B_tag{
A* bb;
int i;
}B;
*/
struct A_tag{
struct B * bb;
int i;
}A;
struct B_tag{
struct A * bb;
int i;
}B;
typedef struct A AA;
typedef struct B BB ;
* this pair won't work -- error: parse error before "B"
typedef struct A_tag{
B * bb;
int i;
}A;
typedef struct B_tag{
A* bb;
int i;
}B;
*/
struct A_tag{
struct B * bb;
int i;
}A;
struct B_tag{
struct A * bb;
int i;
}B;
typedef struct A AA;
typedef struct B BB ;
Wiki
Trigraph | Equivalent | Digraph |
??= | # | %: |
??/ | \ | |
??' | ^ | |
??( | [ | <: |
??) | ] | >: |
??! | | | |
??< | { | <% |
??> | } | %> |
??- | ~ |
printf
int c; char abc[]="abcdefghijklmnopqrstuvwxyz"; for(i=0; i< 10; i++){ printf("%.*s\n",i,abc); } return EXIT_SUCCESS; a ab abc abcd abcde abcdef abcdefg abcdefgh abcdefghi
#include <stdarg.h> // or #include <varargs.h> for Win32 char* Func(char* buffer, const char* format, ...){ va_list ap; va_start(ap, format); vsprintf(buffer, format, ap); va_end(ap); return buffer; }
int Func2(int n, ...){ int sum; va_list ap; va_start(ap, n); for (int i = 0; i < n; i++){ sum += va_arg(ap, int); } va_end(ap); return sum; }
#pragma pack(push,1) typedef struct tagS{ char ch1; int i1; } S; #pragma pack(pop) #pragma warning( push ) #pragma warning(disable : 4996) #pragma warning( pop ) #pragma comment( lib, "abc.lib" )
The GNU C Library
curses
newlib
lfds, a portable, license-free, lock-free data structure library written in C.
curses
newlib
lfds, a portable, license-free, lock-free data structure library written in C.
The C Library Reference Guide?
最新コメント