相关疑难解决方法(0)

std :: iterator,指针和VC++警告C4996

int *arr = (int*) malloc(100*sizeof(int));
int *arr_copy = (int*) malloc(100*sizeof(int));
srand(123456789L);
for( int i = 0; i < 100; i++) {
    arr[i] = rand();
    arr_copy[i] = arr[i];
}

// ------ do stuff with arr ------

// reset arr...
std::copy(arr_copy, arr_copy+100,  arr);
Run Code Online (Sandbox Code Playgroud)

在编译时,我得到以下警告std::copy():

c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(2227):
warning C4996: 'std::_Copy_impl': Function call with parameters that may be
unsafe - this call relies on the caller to check that the passed values are 
correct. To disable this warning, …
Run Code Online (Sandbox Code Playgroud)

c++ algorithm iterator stl

11
推荐指数
3
解决办法
1万
查看次数

标签 统计

algorithm ×1

c++ ×1

iterator ×1

stl ×1