Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.

Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.

Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.

If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.

Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.

Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.

Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.

If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.

No advertising or soliciting.

We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.

If you have a question about an article, use the forum at the bottom of that article. That way, the author will be notified of your question, and you're not relying on them stumbling across your question in a completely different part of the site.

"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

at best, i would think the behavior is undefined. the function is going to try to find a parameter, somewhere. maybe it pulls some random garbage off the stack where it expects a parameter to be, or maybe your compiler puts variables into certain registers (and so the function will just grab random garbage out of a register).

You shoud correct your caller.h to have the correct prototype for A(). Then #include caller.h in both where you define A() and where you invoke it.

This "works", due to C calling conventions, where the caller is responsible for pushing and popping arguments off the stack. In your case the caller doesn't push anything on the stack. When A() executes it will use whatever values are on the stack as its parameters, which in this case could be any value at all.

Further to this, in C the declaration void f(); does not declare a function with no parameters, but declares a function with an unknown number of parameters. If you know that a function takes no arguments, you should prototype it as void f(void);. Otherwise, the compiler will happily let you do the following:

void f();
int main(void)
{
f();
f(15);
f("Hello", "World");
}

Using gcc I can compile the above with -Wall -Wextra, and get no warnings. If I add -Wstrict-prototypes, I do get the warning "function declaration isn’t a prototype [-Wstrict-prototypes]. If you're using MS-VSC, there's probably a similar warning flag that you can use.

As I told - I'm not sure OP knows the difference between C and C++ and what language is the project in (a leftover from someone else probably)...
Taking in count, that it is part of code from a working system, and that the mentioned compiler can compile both C and C++, and the abilities of C and C++ I put my bet on OP's mistake...
In fact if we stick to the C version, it can not work at all (C has only the varargs option, but that forces at least one named parameter, which we have not)...

I have a application which needs to read a file of size 113MB and stores each row data into a class object which is in turn stored in a std::map<int, CMyClassObject>. Running it in 32-bit 4 GB RAM , the "Out of Memory" error triggered. After a observation , I felt that the RAM is not sufficient, so now I tried it in 64-bit 8GB RAM system but still the same exception is thrown. Can anyone help me in finding what exactly might be problem and how it can be overcome?