Hi everyone,
I've just created a function in a header file that accept a string and
parse but the prototipe of the function return me an exception:
#include <stdio.h>
#include <string.h>
int Scan(char Search[]) // this generate the exception
{
// char Search[] = "Sample text"; //only in this way
that perfectly works!
char *pch;
pch = strtok (Search," -,.");
while (pch != NULL)
{
printf ("%s\n",pch);
//
// some other code here...
//
pch = strtok (NULL, " -,.");
}
}
the function must accept the string.
I use this header whith this sample.cpp
#include "myHeader.h"
int main()
{
Scan("Hi everyone");
return 0;
}
the function return an error when i try to parse a string whith " -,."
Can you help me please?
Thx for all!
Federico