What you've been given is the function prototype, which describes to the compiler the "signature" of the function. When you write your implementation (definition) of it, you must supply parameter names for the function to use. So in your program, it might look like:
#include <iostream>
using namespace std;
int func1(char *, unsigned int); //prototype, note the semicolon at end
int main( )
{
char str[256] = "";
int num = 3;
int ret_val = 0;
ret_val = func1( str, num );
return 0;
}
int func1(char * foo, unsigned int bar) //parameter names here
{
strcpy( foo, "hello" );
for( int i = 0; i < bar; i++ )
strcat( foo, " world" );
return strlen( foo );
}
Reputation Points: 1268
Solved Threads: 228
Posting Virtuoso
Offline 1,895 posts
since Aug 2007