2
2005
1) What is the big deal about * in front of RandStr ? - I guess it
means pointer to function - but what are the benefits?
2) If I call the RandStr in main or another function, would
char str[6];
str = RandStr
work? Why not?
char *RandStr(void)
{
int i;
char RandStr[5];
for(i = 0; i <= 5; i++)
{
RandStr = rand() % 78;
}
return RandStr;
}
means pointer to function - but what are the benefits?
2) If I call the RandStr in main or another function, would
char str[6];
str = RandStr
work? Why not?
char *RandStr(void)
{
int i;
char RandStr[5];
for(i = 0; i <= 5; i++)
{
RandStr = rand() % 78;
}
return RandStr;
}