Skip to content

A) How it's look

kalinosia edited this page Mar 13, 2021 · 1 revision

INCLUDE AND USING

BIBLIOTEKI

#include <iostream>

PLIKI KTÓRE MAMY W PROJEKCIE

#include "nazwapliku.rozszerzenie" (np. "headers.h")

NAMESPACE

using namespace std; It's ok to use this. In small projects. In projects where we don't use different namespace. But when we have more libraries and we need use diferrent namespace then we need use std:: before some expression (...). For exaple:

int main()
{
    int i=0;
    std::cout<<"Give me some number: ";
    std::cin>>i;
    std::cout<<"Thanks"<<std::endl;
}

Możemy tworzyć w innych plikach i dodawać. Np.:

#include <iostream>

....

namespace{

class.....

....

}

OUTPUT

std::cout << "Hello world!" << std::endl; 

std::cout << "Hello world second!" << flush;

INPUT

string name;

std::cout << "Your name is : " << flush;

std::cin >> name;

Clone this wiki locally