I need help Tokenizer 628

#include
#include<string.h>
#include
using namespace std;

char *tok(char s[], char d)
{
static char *ptr=NULL;
if(s!="\0")
{ptr=s;
}
if(ptr==NULL)
{
return NULL;
}

char *output=new char[strlen(s)+1];
int i;
for(i=0;ptr[i]!='\0';i++)
{
    if(ptr[i]!=d)
    output[i]=ptr[i];

else{
 { output[i]='\0';
ptr=ptr+i+1;
return output;
}
}
output[i]='\0';
ptr=NULL;
return output;

}

int main()
{

char s[]=“hi this is the new way of coding”;
char pt;
pt=tok(s," “);
while(pt!=NULL)
{
cout<<pt<<endl;
pt=tok(NULL,” ");
}
return 0;
}
can anyboldy help it is compiler error
main.cpp: In function ‘char
tok(char*, char)’:
main.cpp:44:1: error: a function-definition is not allowed here before ‘{’ token
{
^
main.cpp:55:1: error: expected ‘}’ at end of input
}
^

Hello @neeleshr628,

The way you have shared your code is introducing many syntax errors to it.
Please, share your code using Online Coding Blocks IDE.

  1. Paste your code there.
  2. Save your code .
  3. Share the URL with me.

@neeleshr628, You have not replied to this thread for 5 days.

If you have solved your problem, then mark this doubt as resolved.
Else let me know, if you are still facing any issue.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.