+ 1
do i have to add #include<iostream> using namespace std after every {} block
i know these are dumb questions sorry
3 Respostas
+ 5
just include it once at the top of ur file
#include <iostream>
using namespace std;
//All ur code here
+ 4
no. you only have to (and should) include files once.
There is actually two lines of code in your question. each line performs a seperate function.
#include<iostream>
#include 'includes' the file specfied in < file > or " file.h" so basically the file gets typed in front of what you write.
and then there is
using namespace std;
Using namespaces allows you to reference functions within the namespace without qualifiers.
name spaces are a good way to seperate your code but yeah. google namespaces c++.
0
Not really , there are also file specifics such as #include <string>.