You're passing 'mat' (a single double, despite its name), instead of 'arr' (a 2D array of doubles).
When posting code, please use code formatting with [code] [/code] tags, and include the stuff before main, like #include statements and using statements.