Warning. Wie behandeln?



  • Bekomme folgende Warning

    warning C4996: 'std::basic_string<_Elem,_Traits,_Ax>::copy': 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, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
    1> with
    1> [
    1> _Elem=char,
    1> _Traits=std::char_traits<char>,
    1> _Ax=std::allocator<char>
    1> ]
    1> C:\Programme\Microsoft Visual Studio 9.0\VC\ce\include\xstring(1719) : see declaration of 'std::basic_string<_Elem,_Traits,_Ax>::copy'
    1> with
    1> [
    1> _Elem=char,
    1> _Traits=std::char_traits<char>,
    1> _Ax=std::allocator<char>
    1> ]

    Hier noch de passende Quelltext dazu
    [cpp]
    for(std::vectorstd::string::iterator it = zeilen.begin(); it != zeilen.end(); ++it)
    {
    char temp[20];
    size_t length;
    length = it -> copy(temp, 4, 3);
    temp[length] = '\0';
    std::string temp2 = temp;
    [/cpp]
    An der markierten Stelle tritt die Waring auf. Hat jemand ne Idee wie ich die Warning behandeln soll?




Anmelden zum Antworten