I'm trying to reverse a string using pointers which is I guess a pretty standard program.
I tried doing this using a single pointer unlike other methods I've seen where people use two pointers for beginning and end.
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
void main()
{
clrscr();
char x[15];
cout<<"enter word";
gets(x);
int l=strlen(x);
char* p;
p=x[15];
for(int i=l-1;i>=0;i++)
{
p*=x[i];
p--;
}
puts(x);
getch();
}
I expected it to work but it shows a single error that it can't convert char* to char. I'm pretty new to pointers but I thought pointers are just aliases for the memory locations so what's the problem? Or am I missing something fundamental?