Michael Rasmussen wrote:
On Thu, 09 Feb 2006 03:27:15 -0800, Perro Flaco wrote:
void name_function(char *filename) {
...
}
}
name_function("file.txt");
You are passing a constant and not a pointer. Try: void
name_function(const char *filename)
I don't think that, in itself, that is the OP's problem. The conversion
from string literal to non-const char* is deprecated and should be
avoided, but it's not technically incorrect.
Of course, if the data pointed to by filename is modified in any way
inside name_function, that's undefined behaviour and all bets are off.
That could be the OP's problem, but without seeing the code, who knows
....
Gavin Deane