Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

output of the programme and i dont know where is error in this code

0 votes
asked Jan 23, 2019 by sandeep
#include <stdio.h>
void fun(char **);
int main()
{
     char*argv[]={"ab", "cd", "et'', "gh"};
     fun(argv);
     return 0;
}
void fun(char **p)
{
char *t;
t = (p+=sizeof(int))[-1];
printf("%s\n", t);
}

1 Answer

+1 vote
answered Jan 23, 2019 by Admin (5,110 points)
#include <stdio.h>
void fun (char **);
int main ()
{
  char *argv[] = { "ab", "cd", "et", "gh" }; // You had error on this line
  fun (argv);
  return 0;
}

void fun (char **p)
{
  char *t;
  t = (p += sizeof (int))[-1];
  printf ("%s\n", t);
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...