# mco_calc_init

> Initialize the calculator.

### Prototype

        void	mco_calc_init(	/*OUT*/ mco_calc_t * calc,
                   /*IN*/ mco_dictionary_h dict  );

### Arguments

calc | A handle to the initialized calculator object
dict | A handle to the dictionary created by the eXtremeDB schema compiler `mcocomp`. Normally, this handle is passed in by dbname`_get_dictionary ()`

### Description

This function initializes the calculator structure setting the `dict` element.

### Return Codes

void | No value returned

### Example

        Application snippet:

        const char * dbname = "calc_db";

        int main(int argc, char* argv[])
        {
            MCO_RET            rc;
            mco_device_t       dev;
            mco_calc_t calc;
            mco_db_params_t    db_params;

            mco_runtime_start();
            ...
            mco_calc_init(&calc, calc_db_get_dictionary());

            ...
        }

> For further implementation details see SDK sample "samples/native/core/17-statistics/dbcalc".

> Related Topics

### Files

Header file:
mcodbcalc.h
Source file:
mcodbcalc.c
Library:
libmcodbcalc.a