我想提出一个vsual C++程序,它是如下外的局部变量:如何访问循环
char* StartPosition;
size_t skip=0; //inside the do loop i am incrementing this "skip" but when i come
// out of the loop it again becomes Zero and the same thing repeats again and again. I now it
// expects me to do some thing like skip=skip+ some_Increment(increment by 512+distance) and
// the problem is this"distance" i am getting dynamically.which i am not able to do above.
char contents [100];
do
{
int SizeOfFile = CreateOctalToInteger(&buffer[skip+124],11); //this is a function call. here i am getting the size of some file .
size_t distance= ((SizeOfFile%512) ? SizeOfFile + 512 - (SizeOfFile%512) : SizeOfFile); //here i done some manupulation on the size i received. what manupilation ??
//doesn't matter for now.
skip= distance +512;
memcpy(contents,&buffer[skip],100);
if (StartPosition=strstr(contents,".c"))
{
MessageBox(m_hwndPreview,L"finally string is copied",L"BTN WND6",MB_ICONINFORMATION);
break;
}
return true;
}
while(strstr(contents,".html") != NULL);
请告诉我,如果这个问题不明确。我想要做的是对于每次执行,skip的值应该增加(根据size_t skip = distance + 512;),但是在这里,发生的是每次控制从循环中出来时,它会再次初始化用零跳过,然后重复相同的事情。请给我解决这个问题的方法。
你好再次,是否真的需要这[一个新的问题[this]之后(http://stackoverflow.com/questions/17920081/how-to-skip-a-file-inside-the -tar-file-to-get-a-particular-file/17924563#17924563) –
这是你重复调用的例程吗?你想大小保持其价值? – Jiminion
有两个变量名为跳过不帮助的东西..... – Jiminion