Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

ReplaceC

DEPRECATED. Replaces all occurrences of a specified element in the source string with another element.

Syntax

IppStatus ippsReplaceC_8u(const Ipp8u* pSrc, Ipp8u* pDst, int len, Ipp8u oldVal, Ipp8u newVal);

Include Files

ippch.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib

Parameters

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.

Description

NOTE:
This function is deprecated and will be removed in a future release. If you have concerns, open a ticket and provide feedback at https://supporttickets.intel.com/.

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.

Return Values

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.

Example

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.