#include<iostream.h>
#include<conio.h>
void print(char *str){
cout<<str;
}
int main(){
clrscr();
char str[]="abcdef";
print(&str);
getch();
return 0;
}
Error
1. Cannot convert 'char[7]' to 'char *'
2.Type mismatch in parameter 'str' in call to print(char *)
Since the parameter list of function print consists of a pointer, then passing &str in function call should be correct
Also if I remove the '&' the program runs fine (even though the print function requires a character reference).