passing character array from functions

I need to pass one charcter, and the function will print the expected result.
#include<ncurses.h>
void passchar(int=24 , char='f');

int main()
{

initscr();
passchar(50,'g');

getch();
endwin();
return 0 ;
}

void passchar(int num, char chr[])
{

for(int i=0;i<num;i++)
{
move(i,2*i);
printw(chr);
}
}

This default arguments method works in iostream , but in ncurses it gives errors.
undefined reference to `passchar(int, char)'

what is this error and how to fix this or if this method is wrong the correct method please ?
Well, your prototype states that you are going to pass an int and a char, but then your actual definition says you are passing an int and a char*. You'll need to make them the same somehow.
rather than that is there any way to print the character which we insert by calling the function. ?(without default arguments even)
if you know please ...
Topic archived. No new replies allowed.