#include<stdio.h>#include<stdlib.h>#include<string.h>#include<sys/wait.h>#include<unistd.h>enum{BUF_SIZE=4096};intmain(intargc,char*argv[]){intpipe_fd[2];charbuf[BUF_SIZE];ssize_t numRead;if(argc!=2){fprintf(stderr,"Usage: %s string\n",argv[0]);exit(EXIT_FAILURE);}if(pipe...
文字列 // Token string ・int 長さ // Token length △ C#ソースコード tokenize.cs /// トークン種類 enum TokenKind{ /// 予約語 TK_RESERVED, // 記号 /// return文 TK_RETURN, // リターン文 /// 識別子/summary> TK_IDENT, // 識別子 /// 整数/summary> TK_NUM, // 整数ト...
#include<ctype.h>#include<stdio.h>#include<stdlib.h>#include<string.h>enum{MAX_LEN=1024};intmain(void){size_t len;intshift;char*text;charnum[16];text=malloc(MAX_LEN);if(text==NULL){perror("malloc");exit(EXIT_FAILURE);}printf("Input text to be encrypted (lowercase): ");fflush(st...
#include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/shm.h> #include <sys/stat.h> #include <unistd.h> #include <wait.h> enum { SEGMENT_SIZE = 0x6400 }; const char *data = "Hello there!"; int main(int argc, char *argv[]) { int ...
#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 100 typedef enum { 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(...