Hello,
I've a curious behavior in a C program. I pass a few arguments to a function with the following signature in a file called foo.c:
foo (char *first, size_t a, size_t b, size_t c, char *last);
Now, when I call this function from another C file that includes foo.h, e.g. with:
foo("first value", 1, 2, 3, "last value");
in foo first, a, b, c are correct but last is always NULL. It does not matter what kind of type I use as the last parameter nor from where I call this function (even directly in main without any previous operations). The files are compiled and linked together in one executable. When I put foo () in the same source file from where it is called everything works.
Does anyone have an idea what might be the reason why when the function is outsourced the last parameter is NULL?