C++, like C, is primarily a compiled language. It means that, in order to run a program, it must first be in a language the machine can understand.
Interpreted languages, by comparison, execute code by interpreting a language in real time. Compiled languages have a performance advantage over them because the interpretation is done only once: at compile time.
The std namespace encompasses all the classes and functions defined in the C++ standard library.
If you mean what usingnamespace std means, it's a shortcut to avoid putting std:: in front of every type defined in that namespace:
1 2 3 4 5 6
#include <iostream>
int main(){
std::cout <<"Hello, World!"<<std::endl;
return 0;
}
I myself don't like usingnamespace, but I seem to be a minority.
C++ is not acually a language your computer understands. You computer understands assembly. When you compile your program the C++ is being translated downwards into a language your computer can understand. This is created in an .exe file, which you are of course running.
To understand what using namespace std is you must know what a namespace is.
Basically in the stl there are a lot of variables and identifiers. The problem is when we include parts of the stl in our program all of those variable names, function names, and identifiers are reserved for the stl functions. A lot of people have troubles accidentally making variables that are already in the stl and getting conflict issues and not knowing how to solve it.
The namespace is sort of a container that holds all of those variables, functions, and identifiers in it. When you use a namespace normally you'd call something like std::cout so that if you have something else called cout the compiler could tell the difference between the two.
So, now that we know about these reserved names, what if we don't want to type std:: all the time because we're not going to make anything to conflict with those reserved names anyway?
That is what using namespace std is for, basically it tells your compiler 'if I didn't declare a variable or function go look in std:: for it without my implicitly telling you to every time'.
which are some of the best compilers ?
Can I download them from the internet ,If yes from which website ?
what does it mean that one variable has 512 bytes and one has different ?
like folded double :: or something like that