bg1wiki @ ウィキ内検索 / 「sprintfプロジェクト」で検索した結果
-
sprintfプロジェクト
sprintf.c #include stdio.h int main(void){ char str1[] = "ABCDE"; char str2[] = "FGHIJ"; char str3[15]; int i = 30; sprintf(str3, "%s %d %s", str1, i, str2); printf("%s\n", str3); return 0; }
-
printf
機能 変数の値やリテラルなどを指定の書式で標準出力に出力する。 書式 #include stdio.h /* 標準入出力を扱うヘッダ */ int printf(const char *format, ...); 書式指定子 %d 符号つき整数値(10進数)として出力 %u 符号なし整数値(10進数)として出力 %f 実数値として出力 %lf 倍精度実数値として出力 %c 文字として出力 %s 文字列として出力 %x 整数値(16進数)として出力 %p ポインタ(アドレス)として出力 書き方 リテラルを表示する場合 printf("%d,%f,%c", 25, 1.23, A ); 変数を表示する場合 printf("%d,%f,%c", i, f, c...
-
printfプロジェクト
printf.c /*------------------------------------------------------------------------------ * Title printf * Project printf * Source printf.c * Author B.G * Group B.G * Created 9 54 2009/09/28 * Last Modified 9 54 2009/09/28 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* main...
-
fprintfプロジェクト
fprintf.c #include stdio.h int main(void){ FILE *fp; fp = fopen("test.txt", "w"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } printf("Open file succeed!\n"); printf("Write file start.\n"); fprintf...
-
C言語
...eadプロジェクト sprintfプロジェクト sscanfプロジェクト isalphaプロジェクト toupperプロジェクト strcpyプロジェクト strcatプロジェクト strlenプロジェクト strcmpプロジェクト strstrプロジェクト strtokプロジェクト atoiプロジェクト mallocプロジェクト callocプロジェクト freeプロジェクト reallocプロジェクト randプロジェクト srandプロジェクト perrorプロジェクト サブカテゴリ 特になし
-
ifプロジェクト
if.c /*------------------------------------------------------------------------------ * Title if * Project if * Source if.c * Author B.G * Group B.G * Created 0 14 2009/11/11 * Last Modified 0 14 2009/11/11 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* main関数 */ int main...
-
scanfプロジェクト
scanf.c /*------------------------------------------------------------------------------ * Title scanf * Project scanf * Source scanf.c * Author B.G * Group B.G * Created 23 00 2009/10/20 * Last Modified 23 00 2009/10/20 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* main関数...
-
fscanfプロジェクト
fscanf.c #include stdio.h int main(void){ FILE *fp; int a, b, c; fp = fopen("test.txt", "r"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } printf("Open file succeed!\n"); printf("Read format file start.\n")...
-
sscanfプロジェクト
sscanf.c #include stdio.h int main(void){ char str1[] = "ABCDE 30 FGHIJ"; char str2[6]; char str3[6]; int i; sscanf(str1, "%s %d %s", str2, i, str3); printf("%s\n", str2); printf("%d\n", i); printf("%s\n", str3); return 0; &n...
-
pointerプロジェクト
pointer.c /*------------------------------------------------------------------------------ * Title pointer * Project pointer * Source pointer.c * Author B.G * Group B.G * Created 14 16 2009/12/08 * Last Modified 14 16 2009/12/08 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /...
-
stringプロジェクト
string.c /*------------------------------------------------------------------------------ * Title string * Project string * Source string.c * Author B.G * Group B.G * Created 12 41 2009/12/07 * Last Modified 12 41 2009/12/07 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* ma...
-
forプロジェクト
for.c /*------------------------------------------------------------------------------ * Title for * Project for * Source for.c * Author B.G * Group B.G * Created 11 52 2009/11/14 * Last Modified 11 52 2009/11/14 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* main関数 */ int ...
-
fwriteプロジェクト
fwrite.c #include stdio.h struct struct_test{ int data_i; char data_str[10]; }; int main(void){ struct struct_test test1; FILE *fp; printf("input data_i "); scanf("%d", test1.data_i); printf("input data_str "); scanf("%s", test1.data_str); &nb...
-
fseekプロジェクト
fseek.c #include stdio.h int main(void){ FILE *fp; int point; int c; printf("read point "); scanf("%d", point); if (point = 0){ fp = fopen("test.txt", "r"); if (fp == NULL){ printf("Can t open file!\n"); re...
-
whileプロジェクト
while.c /*------------------------------------------------------------------------------ * Title while * Project while * Source while.c * Author B.G * Group B.G * Created 12 07 2009/11/14 * Last Modified 12 07 2009/11/14 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* main関数...
-
callocプロジェクト
calloc.c #include stdio.h #include stdlib.h int main(void){ int *p_malloc; int *p_calloc; int i; p_malloc = NULL; p_calloc = NULL; printf("malloc example.\n"); printf("first call malloc.\n"); p_malloc = (int *)malloc(sizeof(int) * 5); if (p_malloc != N...
-
literalプロジェクト
literal.c /*------------------------------------------------------------------------------ * Title literal * Project literal * Source literal.c * Author B.G * Group B.G * Created 5 29 2009/09/15 * Last Modified 5 29 2009/09/15 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* ...
-
getcプロジェクト
getc.c #include stdio.h int main(void){ FILE *fp; int c; fp = fopen("test.txt", "r"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } c = getc(fp); printf("getc %c\n", (char)c); fclose(fp); r...
-
ftellプロジェクト
ftell.c #include stdio.h int main(void){ FILE *fp = NULL; char str[100]; long pos; fp = fopen("test.txt", "a"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } printf("Input text \n"); while(1){ scanf...
-
freadプロジェクト
fread.c #include stdio.h struct struct_test{ int data_i; char data_str[10]; }; int main(void){ struct struct_test test1; FILE *fp; fp = fopen("test.txt", "rb"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } fread( test1, sizeo...
-
arrayプロジェクト
array.c /*------------------------------------------------------------------------------ * Title array * Project array * Source array.c * Author B.G * Group B.G * Created 14 47 2009/12/04 * Last Modified 14 47 2009/12/04 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* main関数...
-
putcプロジェクト
putc.c #include stdio.h int main(void){ FILE *fp; int c = X ; fp = fopen("test.txt", "w"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } putc(c, fp); printf("putc %c\n", (char)c); fclose(fp);  ...
-
strcmpプロジェクト
strcmp.c #include stdio.h #include string.h int main(void){ char buf[256]; printf("Input string "); scanf("%s", buf); if (strcmp(buf, "hoge") == 0){ printf("buf == hoge\n"); printf("buf %s\n", buf); } else{ p...
-
structプロジェクト
struct.c /*------------------------------------------------------------------------------ * Title struct * Project struct * Source struct.c * Author B.G * Group B.G * Created 10 15 2009/12/09 * Last Modified 10 15 2009/12/09 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* 構造...
-
strcatプロジェクト
strcat.c #include stdio.h #include string.h int main(void){ char str_src1[] = "hoge"; char str_src2[] = "foobar"; char str_dest[11]; printf("str_src1 = %s\n", str_src1); printf("str_src2 = %s\n", str_src2); strcpy(str_dest, str_src1); printf(...
-
strlenプロジェクト
strlen.c #include stdio.h #include string.h int main(void){ char buf[256]; int len; printf("Input string "); scanf("%s", buf); len = strlen(buf); printf("buf %s\n", buf); printf("len %d\n", len); return 0; }
-
fputcプロジェクト
fputc.c #include stdio.h int main(void){ FILE *fp; int c = X ; fp = fopen("test.txt", "w"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } fputc(c, fp); printf("fputc %c\n", (char)c); fclose(fp); &n...
-
strstrプロジェクト
strstr.c #include stdio.h #include string.h int main(void){ char buf[256]; char *find_str_ptr; find_str_ptr = NULL; printf("Input search string "); scanf("%s", buf); if ((find_str_ptr = strstr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", buf)) == NULL){ printf...
-
fopenプロジェクト
fopen.c #include stdio.h int main(void){ FILE *fp; fp = fopen("test.txt", "r"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } printf("Open file succeed!\n"); fclose(fp); return 0; }
-
fgetcプロジェクト
fgetc.c #include stdio.h int main(void){ FILE *fp; int c; fp = fopen("test.txt", "r"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } c = fgetc(fp); printf("fgetc %c\n", (char)c); fclose(fp); ...
-
mallocプロジェクト
malloc.c #include stdio.h #include string.h #include stdlib.h int main(void){ char str1[10]; char *p_str2; int n; int i; printf("n "); scanf("%d", n); printf("str1 "); scanf("%s", str1); p_str2 = (char *)malloc(strlen(str1) *...
-
fgetsプロジェクト
fgets.c #include stdio.h int main(void){ FILE *fp; char str[6]; fp = fopen("test.txt", "r"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } fgets(str, 6, fp); printf("fgets %s\n", str); fclose(fp); &...
-
fputsプロジェクト
fputs.c #include stdio.h int main(void){ FILE *fp; char str[] = "ABCDE"; fp = fopen("test.txt", "w"); if (fp == NULL){ printf("Can t open file!\n"); return -1; } fputs(str, fp); printf("fputs %s\n", str); fclos...
-
staticプロジェクト
static.c #include stdio.h void static_int_print(void); int main(void){ static_int_print(); static_int_print(); static_int_print(); return 0; } void static_int_print(void){ static int s_i; printf("%d\n", s_i); s_i++; }
-
randプロジェクト
rand.c #include stdio.h #include stdlib.h int main(void){ int i; for (i = 0; i 20; i++){ printf("random no %d\n", rand() % 20 + 1); } return 0; }
-
strcpyプロジェクト
strcpy.c #include stdio.h #include string.h int main(void){ char str_src[] = "STRING"; char str_dest[7]; printf("src_src = %s\n", str_src); strcpy(str_dest, str_src); printf("src_dest = %s\n", str_dest); return 0; }
-
getsプロジェクト
gets.c #include stdio.h int main(void){ char str[20]; printf("str(gets) "); gets(str); puts(str); return 0; }
-
if_elseプロジェクト
if_else.c /*------------------------------------------------------------------------------ * Title if_else * Project if_else * Source if_else.c * Author B.G * Group B.G * Created 0 24 2009/11/11 * Last Modified 0 24 2009/11/11 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ /* ...
-
reallocプロジェクト
realloc.c #include stdio.h #include stdlib.h int main(void){ int *p_realloc; int i; p_realloc = NULL; printf("malloc example.\n"); p_realloc = (int *)malloc(sizeof(int) * 5); if (p_realloc != NULL){ for (i = 0; i 5; i++){ (*(p_realloc + i...
-
functionプロジェクト
function.c /*------------------------------------------------------------------------------ * Title function * Project function * Source function.c * Author B.G * Group B.G * Created 10 53 2009/11/27 * Last Modified 10 53 2009/11/27 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ &nbs...
-
do_whileプロジェクト
do_while.c /*------------------------------------------------------------------------------ * Title do_while * Project do_while * Source do_while.c * Author B.G * Group B.G * Created 12 29 2009/11/14 * Last Modified 12 29 2009/11/14 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ &nbs...
-
toupperプロジェクト
toupper.c #include stdio.h #include ctype.h int main(void){ char str[260]; int c; int i; printf("str "); scanf("%s", str); for (i = 0; i 260; i++){ c = toupper((int)str[i]); str[i] = (char)c; } printf("toupper ...
-
srandプロジェクト
srand.c #include stdio.h #include stdlib.h int main(void){ int i; srand(time(NULL)); for (i = 0; i 20; i++){ printf("random no %d\n", rand() % 20 + 1); } return 0; }
-
switch_caseプロジェクト
switch_case.c /*------------------------------------------------------------------------------ * Title switch_case * Project switch_case * Source switch_case.c * Author B.G * Group B.G * Created 0 36 2009/11/11 * Last Modified 0 36 2009/11/11 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクル...
-
variableプロジェクト
variable.c /*------------------------------------------------------------------------------ * Title variable * Project variable * Source variable.c * Author B.G * Group B.G * Created 5 46 2009/09/15 * Last Modified 5 46 2009/09/15 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio.hのインクルード */ ...
-
bit_operatorプロジェクト
bit_operator.c /*------------------------------------------------------------------------------ * Title bit_operator * Project bit_operator * Source bit_operator.c * Author B.G * Group B.G * Created 13 43 2009/11/07 * Last Modified 13 43 2009/11/07 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /* stdio....
-
externプロジェクト
main.c #include stdio.h void extern_func(void); int a; int main(void){ a = 2; extern_func(); printf("a = %d\n", a); return 0; } extern.c extern int a; void extern_func(void){ a = a + 2; }
-
increment_decrementプロジェクト
increment_decrement.c /*------------------------------------------------------------------------------ * Title increment_decrement * Project increment_decrement * Source increment_decrement.c * Author B.G * Group B.G * Created 13 01 2009/11/07 * Last Modified 13 01 2009/11/07 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ ...
-
isalphaプロジェクト
isalpha.c #include stdio.h #include ctype.h int main(void){ int c; c = getchar(); if (isalpha(c)){ printf("%c is alphabet.\n", (char)c); } return 0; }
-
arrow_operaterプロジェクト
arrow_operater.c /*------------------------------------------------------------------------------ * Title arrow_operater * Project arrow_operater * Source arrow_operater.c * Author B.G * Group B.G * Created 13 47 2009/12/11 * Last Modified 13 47 2009/12/11 * ---------------------------------------------------------------------------*/ /* ヘッダファイルのインクルード */ #include stdio.h /...
-
@wiki全体から「sprintfプロジェクト」で調べる
更新順にページ一覧表示
|
作成順にページ一覧表示
|
ページ名順にページ一覧表示
|
wiki内検索