I want to pass an arrays index from my function to main. How can I do that? For example:
void randomfunction()
{
    int i;
    char k[20][10];
    for (i=0;i<20;i++)
        strcpy(k[i], "BA");
}
int main(int argc, char *argv[])
{
    int i; for (i=0;i<20;i++) printf("%s",k[i]);
    return 0;
}
I know that for you this is very simple but I've found similar topics and they were too complicated for me. I just want to pass the k array to main. Of course my purpose is not to fill it with "BA" strings...
 
     
     
    