Finding words with the same first character
问题 I've made an array and now I'm trying to compare first symbols of two strings and if it's true to print that word. But I got a problem: Incompatible types in assignmentof "int" to "char"[20]" Here is the code: for ( wordmas= 0; i < character; i++ ) { do { if (!strncmp(wordmas[i], character, 1) } puts (wordmas[i]); } Maybe you guys could help me? 回答1: There are several issues with your code: You do not need strncmp to compare the first character - all you need is a simple == or != . Using a do