Developer Reference for Intel® Integrated Performance Primitives
DEPRECATED. Replaces all occurrences of a specified element in the source string with another element.
IppStatus ippsReplaceC_8u(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u oldVal, Ipp8u newVal);
ippch.h
Headers: ippcore.h, ippvm.h, ipps.h
Libraries: ippcore.lib, ippvm.lib, ipps.lib
pSrc |
Pointer to the source string. |
len |
Number of elements in the source string. |
pDst |
Pointer to the destination string. |
oldVal |
Element to be replaced. |
newVal |
Element that replaces oldVal. |
This function replaces all occurrences of a specified element oldVal in the source string pSrc with another specified element newVal, and stores the new string in the pDst. The operation is case-sensitive.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error condition if at least one of the specified pointers is NULL. |
ippStsLengthErr |
Indicates an error condition if len is negative. |
The code example below shows how to use the function ippsReplaceC_8u.
Ipp8u string[] = "abracadabra"; Ipp8u dst_string [ sizeof (string)]; ippsReplaceC_8u( string, dst_string , sizeof (string), 'a', 'o' ); printf ( "ippsReplaceC_8u returned: %s.\n", (char*) dst_string ); Output: ippsReplaceC_8u returned: obrocodobro.