Iam having problem with the following code:
All this code does is extract words separated by spaces from string
when i compile it i get error27 C:\Dev-Cpp\Untitled1.cpp invalid operands of types `char*' and `char*' to binary `operator*'
plzzzz help
// Tokenizing program:pointer version
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
char str[80];
char token[80];
char *p;
char *q;
cout<<"Enter a sentence: ";
gets(str);
p=str;
// Read a token at a time from the string
while(*p){
q=token;
/* Read character until either a space or the null terminator is encountered
*/
while(*p!=' ' && *p){
*q=*p;
q++;p++;
}
if(*p)p++
*q = '\0';
cout<<token<<"\n";
}
system("pause");
return 0;
}