すいません
void func (char *ch,int max, int :nm)ではなく
void func (char *ch,int max, int *nm)でポインタです。
メイン関数に戻したらエラー的な感じです。