#include<stdio.h> #include<string.h> int main() { char str[100]={0}; char str1[100]={0}; char *p = NULL; puts("enter a string"); fgets(str,sizeof(str),stdin); puts("enter substring"); fgets(str1,sizeof(str1),stdin); p=strstr(str,str1); if(p) puts("sub string is a part of main string"); if(!p) puts("sub string is not a part of main string"); return 0; }
#include <stdio.h> //... int (_cdecl * fpointer)(const char*) = &puts; // where int (_cdecl * fpointer)(const char*) declares the variable "fpointer" // of the type "pointer to the function accepting one argument of the type "const ''char*" // and returning int" // or even void* address = &puts;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)