#概要C言語でコーディングする上で気をつけている点などをまとめて見ました。但し、書き方は人それぞれなので違和感を覚える人もいるかもしれませんが、もし間違っている点がありましたらご指摘お願い致し…
#include <sys/mman.h> #include <string.h> const unsigned int CODE_LEN = 79; int main() { void *output = mmap(NULL, CODE_LEN, (PROT_READ | PROT_WRITE | PROT_EXEC), (MAP_PRIVATE | MAP_ANONYMOUS), -1, 0); char *code = "\x55\x48\x89\xe5\x48\x8d\x35\xf5\xff\xff\x...
(char*ret=dst;n;++ret,++s,--n){*ret=*s;if((unsignedchar)*ret==(unsignedchar)c)returnret+1;}return0;}intmain(){constchar*str1="hello there 1";constchar*str2="hello there 2";charbuffer[MAX];concatStrings(concatStrings(buffer,str1,'\0',MAX)-1,str2,'\0',MAX);printf("%s\n...
文字の入出力操作には、fgetc、getc、fputc、putcharのような複数の関数があります。fgetcとgetcは基本的には同等の機能を持っており、ファイルストリームポインタを取得して文字を読み込み、それをint型にキャストしたunsigned charとして返します。
#define BCD(c) (__bits__[c])staticconstunsignedint__bits__[]={0,1,10,11,100,101,110,111,1000,1001,1010,1011,1100,1101,1110,1111,10000,10001,10010,10011,10100,10101,10110,10111,11000,11001,11010,11011,11100,11101,11110,11111,100000,100001,100010,100011,100100,100101,100110,100111,1010...
Register as a new user and use Qiita more conveniently You get articles that match your needs You can efficiently read back useful information You can use dark theme What you can do with signing up Sign upLogin Comments No comments Let's comment your feelings that are more than good ...
{ Jan, Feb, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC } month; typedef struct { unsigned char dd; month mm; unsigned yy; } date; #define MALLOC_ARRAY(number, type) ((type *)malloc((number) * sizeof(type))) int main() { date *d = NULL; errno = 0; d = ...
次の記事では、C プログラミング言語での signed int と unsigned int の違いについて説明します。
0 more_horiz CancelDelete Comments No comments Let's comment your feelings that are more than good LoginSign Up Qiita Conference 2024 Autumn will be held!: 11/14(Thu) - 11/15(Fri) Qiita Conference is the largest tech conference in Qiita!
はじめに最近C言語を書き始めたという真のC言語初心者向けの記事です。意図通りに動かないプログラムコンパイルは通るものの意図通りに動かないプログラムを書きます。0~15の数字のうち奇数を降順に…