bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why tab = const tab is refused by g++ 2.95.2


From: Jean-François Marronnier
Subject: Why tab = const tab is refused by g++ 2.95.2
Date: Fri, 05 Jan 2001 22:53:26 GMT
User-agent: Mozilla/5.0 (Windows; U; Win95; fr-FR; m18) Gecko/20001106 Netscape6/6.0

Hi all,

During my job I was surprise by a g++ error.
When a copy a tab with a constant tab g++ (version 2.95.2) refuse this copy.

For exemple:
    char table[4];
    char tab_1[4] = "123";

    table = tab_1; // this line is accept table = "123"

    /*
    ** BUT
    */
    char const tab_2[4] = "456";
    table = tab_2; // REJECT ???
// G++ => incompatible type in assignement of const char[4] to char[4]

What is wrong ? In my code the tab_2 is a methode parameter and I wand to insure that it is not modify !!!

Thanks




reply via email to

[Prev in Thread] Current Thread [Next in Thread]