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:
#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
Edited by WingedPanther, 03 April 2008 - 12:42 PM.
Add code tags


Sign In
Create Account

Back to top









