I recently found a strange thing in C++.
Here's the program
#include<iostream>
void fun(int *)
{
std::cout << "Strange!!!\n";
}
int main()
{
int x = 33;
fun(&x);
return 0;
}
I know my fun
is kind of funky, I'm passing a pointer and not using that thing at all. But that's not the point.
The point is why this thing is even compiling ? I don't have a variable for that pointer in there, and It didn't warn me also. Even it compiles then how the heck I'm going to use that pointer inside fun
anyway ? Is it normal ?