// Passing Pointer in Functions
#include <iostream.h>
#include "PtrInFunc.hpp"

int main()
{
    char  str[] = "Hello Master!";
    char  *ch;    
    int   A[] = {2, 4, 6};
    int   *ptr_A;
    int   M[2][2] = {2, 1,
                     4, 3};
    int   *ptr_M;
    float B[] = {2.1, 4.3, 6.2};
    float *ptr_B;

    
    cout << "Print integer vector\n";
    ptr_A = &A[0];   
    PrintVector(ptr_A);
    cout << "Sum = " << SumVector(ptr_A) << endl << endl;

    cout << "Print integer matrix\n";
    ptr_M = &M[0][0];   
    PrintMatrix(ptr_M);
    cout << "Sum = " << SumMatrix(ptr_M) << endl << endl;
        
    cout << "Print float vector\n";
    ptr_B = &B[0];   
    PrintVector(ptr_B);
    cout << "Sum = " << SumVector(ptr_B) << endl << endl;
    
    cout << "Print string\n";    
    ch = str;
    PrintString(ch);
    cout << endl;    
                
    std::cin.get();
    return (0);
}

