If I didn't come to these forums, I would've hit a brick wall.
Code:
#include <stdio.h>
#include <stdlib.h>
#define CHOICE_LENGTH 20
#define TRUE 1
#define FALSE 0
char Choices[5][CHOICE_LENGTH];
int changeValues(char *szOne, char *szTwo, char *szThree, char *szFour, char *szFive);
void showValues();
int main(void) {
if(changeValues( "Birds Singing",
"Happiness Everywhere",
"All colors",
"Rainbow clouds",
"OMG A ZOMBIE"))
{
showValues();
}
return 0;
}
int changeValues(char *szOne, char *szTwo, char *szThree, char *szFour, char *szFive) {
if( strlen(szOne) > CHOICE_LENGTH ||
strlen(szTwo) > CHOICE_LENGTH ||
strlen(szThree) > CHOICE_LENGTH ||
strlen(szFour) > CHOICE_LENGTH ||
strlen(szFive) > CHOICE_LENGTH)
{
return FALSE;
}
strcpy(Choices[0], szOne);
strcpy(Choices[1], szTwo);
strcpy(Choices[2], szThree);
strcpy(Choices[3], szFour);
strcpy(Choices[4], szFive);
return TRUE;
}
void showValues() {
int i;
for(i=0; i<5; i++)
printf("%s\n", Choices[i]);
}
Thank you :)