I came across the following code in "C++ from Beginner to Master" by "明日科技":
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int B_number=66;
char B_as_cha=static_cast<char>(B_number);
printf("%c",B_number);
}
Why do I need to include both <iostream>
and <cstdio>
?
What is the purpose of using namespace std;
?
I noticed the variable B_as_cha
is defined but not used in the printf
function. Is there a reason for this?