--- description: "Learn more about: Warning C26481 NO_POINTER_ARITHMETIC" title: Warning C26481 ms.date: 04/29/2020 f1_keywords: ["C26481", "NO_POINTER_ARITHMETIC"] helpviewer_keywords: ["C26481"] ms.assetid: 4fd8694d-b45b-4163-b2d5-88c4889d00ed --- # Warning C26481 > Don't use pointer arithmetic. Use span instead (bounds.1). ## Remarks This check supports the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md) rule [I.13](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-array): *Do not pass an array as a single pointer*. Whenever raw pointers are used in arithmetic operations they should be replaced with safer kinds of buffers, such as `span` or `vector`. This check is more restrictive than I.13: it doesn't skip `zstring` or `czstring` types. C26481 and [C26485](c26485.md) come from the [Bounds Safety Profile](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#SS-bounds) rules. These rules were implemented in the first release of the C++ Core Guidelines Checker. They're applicable to the raw pointers category since they help to avoid unsafe use of raw pointers. ## Example This sample results in a warning for pointer arithmetic. ```cpp // c26481_bad.cpp // compile using: // set Esp.Extensions=CppCoreCheck.dll // cl /W3 /EHsc /permissive- /analyze /analyze:plugin EspXEngine.dll /analyze:ruleset "%VSINSTALLDIR%\Team Tools\Static Analysis Tools\Rule Sets\CppCoreCheckBoundsRules.ruleset" c26481_bad.cpp int main() noexcept { int * from_array = new int(10); int * later_array = from_array + 1; delete[](from_array); } ```