C言語

構文
strlen(str)
文字列strの長さを取得します。

サンプルコード

#include <stdio.h>#include <string.h>int main(vo ...

C言語

構文
char *strcat(char * restrict s1,const char * restrict s2
);
文字列を連結します。
使用例

#include <stdio.h ...

C言語

構文
char *strcpy(char *s1, const char *s2);
文字列のコピー
s1 コピー先
s2 コピー元
使用例

#include <stdio.h> ...

C言語

説明
char *strcpy(char * restrict s1,const char * restrict s2
);
使用例

#include <stdio.h>#include &l ...

C言語

構文
do {
if(条件式){
//some code
}
}while(条件式)

サンプルコード

#include <stdio.h>int main(void ...

C言語

構文

do{//ループをスキップ if (条件式){//some code continue; }} while(条件式);

サンプルコード

#include <stdio.h>int main(void) ...

C言語

構文
do{
some code
}while(条件式);

サンプルコード

#include <stdio.h>int main(void){/* 変数の宣言 */int m = ...

C言語

構文
変数名–
変数名++
サンプルコード

#include <stdio.h>int main(void){ int m = 120; int n = 120; int res1 ...

C言語

構文
–変数名
++変数名

使用例

#include <stdio.h>int main(void){ int m = 19; int n = 19; int res1; in ...

C言語

char変数の定義
char 変数名

サンプルコード

#include <stdio.h> int main(void){ char cftA, cftB; cftA = 'T'; cftB = ...

C言語

構文
while(条件式){some code}

サンプルコード

#include <stdio.h>int main(){ int i; i=5; while(i < 10){ print ...

C言語

構文
戻り値の型 関数名(引数の型);
サンプルコード

#include <stdio.h>/* 関数のプロトタイプ宣言 戻り値なし*/void funcA(void);/* 関数のプロトタイプ宣言 ...

C言語

構文
戻り型 関数名(型 引数1,型 引数2)
サンプルコード

#include <stdio.h> int sampleFunc(int x, int y){ return x -y;} int m ...

C言語

使用例

#include <stdio.h>/* グローバル変数 */int cftA=120; void func(){/* 関数のローカル変数 */int cftB=140; printf("function p ...

C言語

構文
void 関数名(型 引数1,型 引数2);

サンプルコード

#include <stdio.h>void testfunc(int x, int y){/* 変数の宣言 */int res ...

C言語

構文
main() {
void 関数名();
}

サンプルコード

#include <stdio.h> void testfunc(void){ printf("this is ...

C言語

構文
for (初期化;条件式;変化式){some code}
サンプルコード

#include <stdio.h> int main(void){ int i;/* 繰り返し処理 */for(i=0 ...

C言語

構文

switch(条件式){ case 数値1://some code break; case 数値2://some code break; default://some code break;}

サンプルコード

# ...