@ Joachim thanks for your suggestion finally i have done it the code is as below you can see if you want -
char* StartPosition;
size_t skip= 0;
char HtmlFileContents [200000];
char contents [8000];
do
{
int SizeOfFile = CreateOctalToInteger(&buffer[skip+124],11);
size_t distance= ((SizeOfFile%512) ? SizeOfFile + 512 - (SizeOfFile%512) : SizeOfFile );
skip += distance + 512;
memcpy(contents,&buffer[skip],100);
if (StartPosition=strstr(contents,".html"))
{
MessageBox(m_hwndPreview,L"finally string is copied",L"BTN WND6",MB_ICONINFORMATION);
int SizeOfFile = CreateOctalToInteger(&buffer[skip+124],11);
memcpy(HtmlFileContents,&buffer[skip+512],SizeOfFile);
break;
}
}
while(strcmp(contents,".html") != NULL);
and it can work for every file stored in tar file . we just need to put the file extension (.html in my case) and this code will give us its contents.