what is the difference between ptr() and (ptr)()
plz reply

Assuming that ptr is a pointer to a function, there's no difference. There are only two things you can do with a function: take its address and call it. Because of this limited operation set, the compiler can guess what you want to do from the context. If you're not calling the function then you're taking its address, and if you're not taking its address then you're calling it.

Because of that guessing, all kinds of address-of, indirection, and parentheses operators that are required for object pointers are unnecessary for function pointers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.