/************************************************************************ * * * Copyright Digital Equipment Corporation 1998. All rights reserved. * * * * Restricted Rights: Use, duplication, or disclosure by the U.S. * * Government is subject to restrictions as set forth in subparagraph * * (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR * * 52.227-14 Alt. III, as applicable. * * * * This software is proprietary to and embodies the confidential * * technology of Digital Equipment Corporation. Possession, use, or * * copying of this software and media is authorized only pursuant to a * * valid written license from Digital or an authorized sublicensor. * * * ************************************************************************/ /* strstr_example.c */ #include #include #include main() { static char lookin[] = "that this is a test was at the end"; putchar('\n'); printf("String: %s\n", &lookin[0]); putchar('\n'); printf("Addr: %s\n", &lookin[0]); printf("this: %s\n", strstr(&lookin[0], "this")); printf("that: %s\n", strstr(&lookin[0], "that")); printf("NULL: %s\n", strstr(&lookin[0], "")); printf("was: %s\n", strstr(&lookin[0], "was")); printf("at: %s\n", strstr(&lookin[0], "at")); printf("the end: %s\n", strstr(&lookin[0], "the end")); putchar('\n'); exit(0); }