In below code, I am getting following error.. why it happens? .. i
How to assign it to pointer str? [ without changing a[5][10] to other notation]
cannot convert `char (*)[10]' to `char**' in initialization
Code:int main() { char a[5][10]={"One", "Two", "Three", "Four", "Five" }; char **str=a; // This is not Ok ??? char *b[5]={"One", "Two", "Three", "Four", "Five" }; char **str1 = b; // this is Ok printf("%d %d %d %d\n", sizeof(a), sizeof(str), sizeof(b), sizeof(str1)); printf("%p %p %p %p %p %p\n", a, str, &a[1], &str[1], &a[1][1], &str[1][1]); printf("%p %p %p %p %p %p\n", b, str1, &b[1], &str1[1], &b[1][1], &str1[1][1]); getchar(); return 0; }



LinkBack URL
About LinkBacks



