setw in c++
#include<iostream>
#inclue<iomanip>
// Introducing the concept of setw//
using namespace std;
int main()
{
int i = 13;
cout<<setw(19)<<i;
}
setw in c++
#include<iostream>
#inclue<iomanip>
// Introducing the concept of setw//
using namespace std;
int main()
{
int i = 13;
cout<<setw(19)<<i;
}
setw in c++
setw(int n)
set c++
// constructing sets
#include <iostream>
#include <set>
bool fncomp (int lhs, int rhs) {return lhs<rhs;}
struct classcomp {
bool operator() (const int& lhs, const int& rhs) const
{return lhs<rhs;}
};
int main ()
{
std::set<int> first; // empty set of ints
int myints[]= {10,20,30,40,50};
std::set<int> second (myints,myints+5); // range
std::set<int> third (second); // a copy of second
std::set<int> fourth (second.begin(), second.end()); // iterator ctor.
std::set<int,classcomp> fifth; // class as Compare
bool(*fn_pt)(int,int) = fncomp;
std::set<int,bool(*)(int,int)> sixth (fn_pt); // function pointer as Compare
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us