Answer Posted / abdur rab
#include <stdio.h>
char* str_str ( char* cp_str, char* cp_pattern )
{
char* cp_temp = NULL;
int n_pattern_length = 0;
n_pattern_length = strlen ( cp_pattern );
while ( cp_str && *cp_str ) {
if ( !strncmp ( cp_str, cp_pattern, (
n_pattern_length ) ) ) {
cp_temp = cp_str;
break;
}
else cp_str++;
}
return ( cp_temp );
}
int main ( int argc, char* argv [ ] )
{
char array [] = {"Hello World"};
char* cp_temp = NULL;
cp_temp = str_str ( array, "lo " );
if ( NULL != cp_temp ) {
printf ("\n%s", cp_temp);
} else printf ("\nReturned null");
return ( 0 );
}
Is This Answer Correct ? | 12 Yes | 7 No |
Post New Answer View All Answers
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
How can I find the modification date and time of a file?
What is #define used for in c?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
How is a pointer variable declared?
What are derived data types in c?
Why is %d used in c?
how we can make 3d venturing graphics on outer interface
What is the difference between fread buffer() and fwrite buffer()?
Why is not a pointer null after calling free?
What are the general description for loop statement and available loop types in c?
Explain goto?
What do you mean by dynamic memory allocation in c?
Explain how to reverse singly link list.
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?