I didnt understand the #include parts

I was doing my homework and one of my friends helped me starting the code .But I didnt understand the includes why there are so many ? Please explain separetly .

#include "pch.h"
#include <iostream>
#include <thread>
#include <chrono>
#include <list>
#include <math.h>
#include <stdio.h>
#include <conio.h>
these are all files that will be "inserted" into your file when it compiles, they are collectively known as "header files".

"" means search project folders for the file before system folders
<> means search system folders for the file before project folders
I know what an include means .Im studying computer engineering but Its only been 3 weeks :D . My question is i never used <chrono> or thread or conio before .When Should i use them ?
These are easy to look up online, on a site such as cppreference.cpp . Google is your friend :)

https://en.cppreference.com/w/cpp/chrono
https://en.cppreference.com/w/cpp/header/thread

Although the last is not part of either the C or C++ standard libraries; it's a proprietry library that supplies some enhanced input/output functionality in a standard DOS or Windows console. "Console I/O" -> "conio".

https://en.wikipedia.org/wiki/Conio.h
> My question is i never used <chrono> or thread or conio before .When Should i use them ?

List of standard header files: https://en.cppreference.com/w/cpp/header

<chrono> C++ time utilities
<thread> part of the thread support library

Use them (only) if you need the functionality provided by them.

#include of a standard header, when the functionality provided by it is not used by the program, does no harm (other than, perhaps, a small increase in compile time).
Thank you all soo much
Hello engineergirl99,

With out seeing the rest of the code it is hard to say if you even need the header files "chrono" and "thread".

For "math.h" it is better to use "cmath".

The header file "conio.h" is not a standard C++ header file and is no longer used by IDE and compilers other than Microsoft. Even Microsoft is likely to phase it out in the future.

Hope that helps,

Andy

P.S. If you have your answers do not forget to put a green check on the subject to ler everyone know that you are finished.
Topic archived. No new replies allowed.