- 締切済み
C言語 文字列の操作
文字Cが含まれる個数を求めたいです #include <stdio.h> int str_chnum(const char str[],int c) { int i; int count=0; for(i=0;str[i]!="\0";i++) if (str[i]==c) count++; return(count); } int main(void) { char st[100]; printf("検索文字列を入力してください:"); scanf("%s",st) ; printf("検索文字列数は%uです。\n",st,int str_chnum(const str[],int c)); return(0); } コンパイルできません。なぜですか?printfの行がたぶん間違っていると思うんですが。。。
- みんなの回答 (7)
- 専門家の回答
みんなの回答
- TAMA_1972
- ベストアンサー率50% (1/2)
回答No.7
- php504
- ベストアンサー率42% (926/2160)
回答No.6
- Trick--o--
- ベストアンサー率20% (413/2034)
回答No.5
- episteme_at_goo
- ベストアンサー率25% (9/36)
回答No.4
- PED02744
- ベストアンサー率40% (157/390)
回答No.3
- YamaYoshi
- ベストアンサー率29% (91/313)
回答No.2
- yokomaya
- ベストアンサー率40% (147/366)
回答No.1