#ifndef TPNOFLAGS #define TPNOFLAGS 0x00000 /* フラグの設定なし―獲得できません */ #endif #define TPQCORRID 0x00001 /* 相関 id の設定/獲得 */ #define TPQFAILUREQ 0x00002 /* 障害キューの設定/獲得 */ #define TPQBEFOREMSGID 0x00004 /* メッセージ id の前にキューに登録 */...
P2334R1 preprocessing directives elifdef and elifndef no P2360R0 Extend init-statement to allow alias-declaration no P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals no P2437R1 Support for #warning no P2448R2 Relaxing some constexpr...
MQTT専用プログラムであれば特に気にする必要はないのですが、他にソケット通信をやらせたりしようとする場合は、シングルスレッドよりマルチスレッドの方が、格段にやりやすそうです。Subscriberの実装をselect待ちでやるのは結構面倒で、一応頑張ってはみましたが、ソケットから取得した電文解析...
#include<stdio.h>#include<stdlib.h>#ifndefMAX#defineMAX 10#endifintmain(intargc,charconst*argv[]){char*row1[]={"num","name","sum"};intcol1[]={1,2,3};char*col2[]={"one","two","three"};intcol3[]={1243,14234,3324};printf("%*s | %*s | %*s\n",-3,row1[0],-MAX...
#include<stdio.h>#include<stdlib.h>#include<string.h>#ifndefMAX#defineMAX 100#endifvoid*concatStrings(void*restrict dst,constvoid*restrict src,intc,size_t n){constchar*s=src;for(char*ret=dst;n;++ret,++s,--n){*ret=*s;if((unsignedchar)*ret==(unsignedchar)c)returnret+1;}return0;}...
#ifndef LOGIC_H //二重インクルード防止 #define LOGIC_H#define W 1 #define b 0 を記述すればヘッダーファイルは完成です。 あとはメインのプログラムから重みとバイアスの定義・プロトタイプ宣言の行を削除して、#include "logic.h"で作成したヘッダーファイルをインクルードするよと...
#include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #ifndef NUM_THREADS #define NUM_THREADS 4 #endif void *printHello(void *threadid) { long tid; tid = (long)threadid; printf("Hello There! thread %ld, pthread ID - %lu\n", tid, pthread_self()); ...