Query regarding Pointer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • divakarpandiyan
    New Member
    • Feb 2008
    • 3

    Query regarding Pointer

    Dear All,
    I tried out this program.
    #include<stdio. h>
    #include<conio. h>
    #include<string .h>

    void main()
    {
    int a[2][2] = {1,2,3,4};
    clrscr();
    printf("\n%s",a ++);
    getch();
    }

    When i try to compile this program is throwing error as "L value required"
    I can't understand why because i know array will internally treated as pointer
    so when i increment by ++ it should point to next address.

    for ex;
    if i declare a variable as pointer then i can able to increment by ++
    like int *p;
    then p++ or ++p;

    can u help me in this what is the different
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Question moved to C / C++ forum.

    Comment

    • CProgrammer80
      New Member
      • Feb 2008
      • 2

      #3
      It's a bit more complicated than an array is a pointer... The explanation can be found here more eloquently than I can retype it:

      http://www.lysator.liu .se/c/c-faq/c-2.html

      Comment

      • divakarpandiyan
        New Member
        • Feb 2008
        • 3

        #4
        Originally posted by CProgrammer80
        It's a bit more complicated than an array is a pointer... The explanation can be found here more eloquently than I can retype it:

        http://www.lysator.liu.se/c/c-faq/c-2.html
        Thx a lot :-).Thx for your information i find this site very helpfull for me.

        Comment

        Working...