关于C语言strcpy函数问题

这个代码是直接照着c primer plus第五版 上面的程序写的了,但是运行起来还是有错误,主要问题是strcpy这个函数,下面是报错截图。
图片说明

 #include <stdio.h>
#include <conio.h>
#include <string.h>
#define LEM 5
#define SIZE 40

int main(void)
{
    char qwords[LEM][SIZE];
    char temp[SIZE];
    int i = 0;

    printf("Enter %d words begin with q:\n", LEM);
    while (i < LEM && gets_s(temp, SIZE))
    {
        if (temp[0] != 'q')
            printf("%s doesn't begin with q!\n", temp);
        else
        {
            strcpy(qwords[i], temp);
            i++;
        }
    }
    puts("Here are the words accepted:");
    for (i = 0; i < LEM; i++)
        puts(qwords[i]);

    return 0;
}

strcpy_s(qword[i],40,temp);改为这样试试

改用memcpy更安全,我有一篇关于memcpy函数的实现

改为pwords[0][i],你用的是二维数组,第2个有40字节