1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
int funtionname(int numbers[4][4], int sixteen, bool flag);
int main(int argc, char **argv)
{
int numbers[4][4] = {{ 23, 0, 56, 2 },
{ 10, 23, 45, 6 },
{ 8, 10, 15, 3 },
{ 2, 19, 1, 6 }};
funtionname(numbers, 16, true);
int x;
cin >> x;
return 0;
}
int funtionname(int numbers[4][4], int sixteen, bool flag)
{
if (flag == true)
{
// process row
std::cout << "processing row" << std::endl;
}
else
{
// process column
std::cout << "processing column << std::endl;
}
// do your processing here
for (int rows = 0; rows < 4; rows++)
{
for (int columns = 0; columns < 4; columns++)
{
std::cout << numbers[rows][columns] << " ";
}
std::cout << endl;
}
return 0;
}
|