A
arnuld
int main()
{
const char* arr[] = {"bjarne", "stroustrup", "c++"};
char* parr = &arr;
}
this gives an error:
[arch@voodo tc++pl]$ g++ test.cpp
test.cpp: In function 'int main()':
test.cpp:4: error: cannot convert 'const char* (*)[3]' to 'char*' in
initialization
[arch@voodo tc++pl]$
what is wrong here ?
{
const char* arr[] = {"bjarne", "stroustrup", "c++"};
char* parr = &arr;
}
this gives an error:
[arch@voodo tc++pl]$ g++ test.cpp
test.cpp: In function 'int main()':
test.cpp:4: error: cannot convert 'const char* (*)[3]' to 'char*' in
initialization
[arch@voodo tc++pl]$
what is wrong here ?