question about arrays of strings
Hey,
So I want to compare a part of a string with a word, but the part of the string is in an array of characters. How would i send a part of this or just a single string to strcmp() ? Also, i dont understand why something like this doesnt work:
Code:
#define ACROSS 10 /* 10 by 10 wordsearch */
#define COLUMNS 10
char wordsearch[ACROSS][COLUMNS]
int i;
char temp[10];
for ( i = 0 ; temp[i] != '\0' , i < 10 ; i++ )
{
temp[i] = wordsearch[0][i];
}
printf("%s",temp);
/*Then i could compare temp to the word somehow... but i dont know how i could break it up */
In the end, i basically want a program that will be able to find a given word in the wordsearch and give the first and last subscript of the word in the wordsearch.
Thanks guys!