Under the processinfo function, how can i identify that "are" existed in the *inputx ??
Code:main() { char xyz[20] = "hellohowareyoudoingthere"; processinfo(xyz); } void processinfo(char *inputx) { }
Under the processinfo function, how can i identify that "are" existed in the *inputx ??
Code:main() { char xyz[20] = "hellohowareyoudoingthere"; processinfo(xyz); } void processinfo(char *inputx) { }
>how can i identify that "are" existed in the *inputx ??
>main()Code:#include <string.h> if ( strstr ( inputx, "are" ) != NULL ) { /* "are" was found */ } else { /* Not present */ }
int main ( void )
>char xyz[20] = "hellohowareyoudoingthere";
This totally writes past the end of the array. Do this instead if you have trouble counting characters in a string literal:
>processinfo(xyz);Code:char xyz[] = "hellohowareyoudoingthere";
>}
Squeeze a "return 0;" in between those two lines.
My best code is written with the delete key.