C言語

C言語でレーベンシュタイン距離

#include <stdio.h> #include <string.h> #include <stdlib.h> //最小の数を探す int min(int a, int b, int c) { return a > b ? (b > c ? c : b) : (a > c ? c : a); } //レーベンシュタイン距離を求める int LevenshteinDistance(char *str1, char *str2) { int lenstr1 = strlen(str1)</stdlib.h></string.h></stdio.h>…

「.」と「->」の違い

構造体を関数に渡す際に、値渡しの時は渡した先の関数で「.」を使っても構わないが、参照渡しの時は渡した先の関数で「.」を使うとエラーになる。「->」であればエラーにならない。環境は以下の通りなのだけど、あんまり関係ないような気もする。 C言語自体…