I'm trying to use strcpy in order to put a string in an array of strings. This is my definiton of the arrays:
char movies[10][150], movie[150];
int i = 0, j = 0;
currentChar = getchar();
while(currentChar != EOF)
{
while(currentChar!='\n')
{
movie[i] = currentChar;
currentChar = getchar();
i++;
}
strcpy(*(movies + j*10*15), (char*)movie);
j++;
currentChar = getchar();
}
Trying to debug it in c++ console, I get a 'Buffer is too small' message.
note: My input is "Django unshaved:a bit bloody, but overall a solid film" which does not exceed the 150 chars.
thanks for helping.
edit: code edited to show full picture