hi all, im doing this problem with string manipulation (C programming on MS Visual Studio 2005 Pro Ed.) and im crapping out on calling this function that i have under routines.cpp when trying to call it from main.cpp
the function prototype (which i have under routines.h) is:
int tokenize(char *token[ ], int max_tokens, char *str);
and i have the actual function in routines.cpp as this:
Code:
#include "routines.h"
#include <stdio.h>
#include <string.h>
int tokenize(char token[ ], int max_tokens, char *str)
{
printf("%s\n%s\n\n%s\n",
"The string to be tokenized is:", token,
"The tokens are:" );
str = strtok (token, " ");
while (str != NULL) {
printf("%s\n", str);
str = strtok(NULL, " ");
}
return 0;
}
------------------------------------------------------------
and so, if i wanted to call this function from main.cpp how would i do that?
i have: tokenize(*token, max_tokens, *str);
but i know its wrong because it wont compile. Please help on how to call this function from main.cpp, i have horrible skills with calling functions. THANK YOU IN ADVANCE