/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example of the function wcswcs(const wchar_t*, const wchar_t*).  
   This returns a pointer to the first occurence of a substring in str1 from 
   str2.
*/
#include <wchar.h>
#include <stdlib.h>

int main() { 
    wchar_t str1[100], str2[100];        
    char *line, *line2;
    wchar_t  *retval;
    int len1, len2;
    line = "Today is a very fine day.\n"; 
    line2 ="is";
    len1 = strlen(line);
    len2 = strlen(line2);

    mbstowcs(str1, line, len1);   
    mbstowcs(str2, line2, len2);
    fputs("Original: ", stdout);
    fputws(str1, stdout);
    fputs("String to search for: ",stdout);
    fputws(str2, stdout);
    fputs("\n", stdout);   
    retval = wcswcs(str1,str2);
    fputws(retval, stdout);
    fputs("\n", stdout);     
}

