cpp/cpp07/ex00/main.cpp
Alexandre POMMIER 5509371f35 start cpp07 ex00
2022-08-07 14:05:08 +02:00

51 lines
2.1 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/06 20:20:09 by apommier #+# #+# */
/* Updated: 2022/08/06 21:02:04 by apommier ### ########.fr */
/* */
/* ************************************************************************** */
#include "whatever.hpp"
#include <iostream>
int main( void )
{
//integer
std::cout << "==============INT===============\n";
int a = 2;
int b = 3;
std::cout << "a = " << a << ", b = " << b << std::endl;
std::cout << "---Swap values---\n";
::swap( a, b );
std::cout << "a = " << a << ", b = " << b << std::endl;
std::cout << "min( a, b ) = " << ::min( a, b ) << std::endl;
std::cout << "max( a, b ) = " << ::max( a, b ) << std::endl << std::endl;
//string
std::cout << "==============CHAR===============\n";
std::string c = "chaine1";
std::string d = "chaine2";
std::cout << "c = " << c << ", d = " << d << std::endl;
std::cout << "---Swap values---\n";
::swap(c, d);
std::cout << "c = " << c << ", d = " << d << std::endl;
std::cout << "min( c, d ) = " << ::min( c, d ) << std::endl;
std::cout << "max( c, d ) = " << ::max( c, d ) << std::endl << std::endl;
//float
std::cout << "==============FLOAT===============\n";
float e = 42.042f;
float f = 21.021f;
std::cout << "e = " << e << ", f = " << f << std::endl;
std::cout << "---Swap values---\n";
::swap(e, f);
std::cout << "e = " << e << ", f = " << f << std::endl;
std::cout << "min( e, f ) = " << ::min( e, f ) << std::endl;
std::cout << "max( e, f ) = " << ::max( e, f ) << std::endl;
return (0);
}