0

code 1:

int main()
{
    char ptr[]="uma";
    char *p;
    p=ptr;
    ++*p++;
    printf("%s",p);
    return 0;
}

code 2:

int main()
{
    char *ptr="uma";
    ++*ptr++;
    printf("%s",ptr);
    return 0;
}

code 1 is working fine and giving output as "ma" where as code2 is showing run time error . what exactly is the difference between both of them

BLUEPIXY
  • 39,699
  • 7
  • 33
  • 70
umamahesh
  • 41
  • 4

0 Answers0