mardi 7 avril 2015

Why won't the user defined function run?


Vote count:

0





#include<iostream>
using namespace std;
void mf_rectangle(int c , int r, char char1 );

void mf_rectangle(int c, int r, char char1)
{
for (int i = 1; i <= c; i++)
{
for (int j = 1; j <= r; j++)
cout << char1;
for (int k = (r - 3); k < (r - 2); k++)
cout << char1;

cout << endl;
}
}

int main()
{


int c, r; char char1;
cout << "Please enter the character you want to use: " << endl;
cin >> char1;
cout << "Please enter the number of columns: " << endl;
cin >> c;
cout << "Please enter the number of rows: " << endl;
cin >> r;

return 0;


}


i tried moving the function from the bottom to the top and taking out the void and replacing the void with int. It said it needed a return value. I added return with a value and still no luck



asked 38 secs ago







Why won't the user defined function run?

Aucun commentaire:

Enregistrer un commentaire