here's what i mean:
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void getInput(char code[]);
void scramble(char code[]);
int main()
{
char code[6];
getInput(code);
//i want scramble and print functions to run here, although its not
//possible because i have to repeat the fgets call in getInput
return 0;
}
void getInput(char code[])
{
printf("\nEnter your code : ");
while ( fgets( code, 6, stdin ) != NULL ) {
if ( code[0] == 'Q' )
break;
scramble(code);
printf("\nEnter your code :");
}
}
void scramble(char clode[])
{
printf("done processing..");
}