#include "stdafx.h" #include<stdio.h> #include<string.h> #include<iostream.h> int compareposition(char* str1,char str2); int main() { char SensexGraphUrl[100]; memset(SensexGraphUrl,0,100); int i,j; char* strarray="SENSEXGRAPHURL"; char* str1= "SE"; int count=0; int iLen = strlen(strarray); int iLen1 = strlen(str1) ; int pos=0; for(i=0;i<iLen1;i++) { pos = compareposition(strarray,str1[i]); cout<<"Pos"<<pos <<endl; //strncpy((char*)strarray[pos],"",1); if(iLen1 == 2) { pos = compareposition(strarray,str1[i]); cout<<"Pos"<<pos <<endl; } } return 0; } int compareposition(char* str1,char str2) { int j; int istrlen = strlen(str1); for(j=0;j<istrlen;j++) { if(str1[j] == str2) return j; else continue; } return 0; }
strlen
for(i=0;i<ilen1;i++)> { pos = compareposition(strarray,str1[i]);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)