function&arrays - please help...
I am trying to make a program using functions and arrays.....
It needs to recieve a character array buff of 6 characters. This would be entered by the user. Then the character array buff needs to be printed in the function...
for example
please enter information ==> 123456
output:
buff[0]==> 1
buff[1]==> 2
and so on
This is what i have so far.
#include<iostream.h> // need this!
#include<math.h> // need this!
int main() // need this!
{ // need this!
const char NUMBER = 6; // array declaration
int FUNPROT(int[NUMBER]); // function prototype
char code[NUMBER]; // array declaration
int FUNPROT(int[NUMBER]); // function prototype
char code[NUMBER]; // array declaration
int i;
// so that it repeats only 6 times.. if this wasnt here it would repeat forever
for(i=0; i<NUMBER; i++);
{
cout<<"Enter input here==>";
cin>>code[i];
}
int FUNPROT(int vals[NUMBER])
{
// print out character array in function
for(i=0; i<NUMBER; i++); // print out the number entered
}
}
I'm a little confused... any help would be appreciated.
thank you
marie10913@aol.com
thank you -- one more question
the help i have recieved was great...
i just have one question about the suggestion...
cout << "Enter input #" << i + 1 << " here:" << flush;
on this line what does flush mean or do...
thank you
marie10913@aol.com