deltemis
2010-01-26 15:24:04 UTC
code so far (a lil buggy, kinda stumped):
#include
#include
using namespace std;
int main()
{
void printi(const int data[], int size = 10); //int ver
void printfl(const float data[], int size = 10); //float ver
void printc(const char data[], int size = 10); //char ver
int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
float b[] = {.1, .2, .3, .4, .5, .6, .7, .8, .9};
char c[] = "a, b, c, d, e, f, g, h, i";
printi(a);
printfl(b);
printc(c);
}
void print(const int data[], int size = 10) //int ver
{
int i, amount = 0, x = 10;
for (i = 0; x > i; i++)
cout << data[i];
}
void printfl(const float data[], int size = 10) //float ver
{
int i, x = 10;
float amount = 0;
for (i = 0; x > i; i++)
cout << data[i];
}
void printc(const char data[], int size = 10) //char ver
{
int i, amount = 0, x = 10;
for (i = 0; x > i; i++)
cout << data[i];
}
overall i do not understand fully what i am supposd to do programming wise. i believe i have initiated the arrays to values properly but what's getting me is how do i make the printing functions work and how do i test them for default/non default values?
a classmate gave me an example for test calls from his program and he used
print(a);
print(b, 5);
print(c);
he used those calls to test his functions. how would i get that to work on mine?