Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

Test Data Settings

111_02: How to use a double pointer argument as an input variable?

Question:

How can I use a double pointer argument as an input variable?

Answer:

Follow the procedure below for integer (int, char, etc.) data type double pointer arguments. Ex. func(int** ptr)
Note: This procedure will not work for void type double pointers. For double void type pointers, first complete step 1 below, then refer to FAQ_111_01.

1. Add the pointer argument to the Input Variable List by checking the "Allocate Memory" checkbox.

2. Right-click on the pointer argument and select "Expand Pointer" from the right-click menu. The pointer will be expanded with another pointer (the double pointer) underneath in the Variable List.

3. Add the double pointer argument to the Input Variable List by checking the "Allocate Memory" and the "Pointer with Index" check boxes.

Example Code:

int double_ptr(int** ptr)
{
    if(**ptr)
    {
        return 1;
    }
    else
    {
        return **ptr;
    }
}


Using the above example code, the Input Variables added to the Test CSV would appear as the image below.


Related Technical Tips Search

Other technical tips in GAIO's web site can be searched for using the links below.

Search key word link: Double Pointer | Argument
Technical Tips Google Search


Information Links