problems with char array = char array

前端 未结 2 1529
自闭症患者
自闭症患者 2020-11-29 12:35

I have:

char message1[100];
char message2[100];

When I try to do message1 = message2, I get error:

inco

2条回答
  •  借酒劲吻你
    2020-11-29 13:03

    Your suspicions are correct. C (I'm assuming this is C) treats an array variable as a pointer.

    You need to read the C FAQ about arrays and pointers: http://c-faq.com/aryptr/index.html

提交回复
热议问题