I am trying to copy the String an char pointer to another ?
I tried the code given below .compiled successfully but output is blank(no output) .
a) Where I was wrong?where my programming logic getting fail?
b) How can I improve this code to get desired output?
void main()
{
char *p="krishna";
char *q;
while(*p!='\0')
{
*q++=*p++;
}
printf("%s",q);
getch();
}