C++ Identifiers

This blog post will teach you about C++ Identifiers and their naming rules. I will try to explain the identifier in C++ with an example code. After reading this blog post, I believe you will be able to identify invalid and valid identifiers in C++. What is an identifier in C++? An identifier is a

C++ Identifiers Read More »

Introduction of C++ Data Types

In this blog post, we will learn about C++ data types with the help of examples. But before the classification first let’s understand what is data type. A data type is a classification of data that tells the compiler or interpreter how the programmer intends to use the data. At a high level, we can

Introduction of C++ Data Types Read More »

localtime function in C?

The localtime function in C converts the calendar time pointed to by the timer into a broken-down time, expressed as local time. The localtime function is present in the <time.h> header file.   Syntax of localtime: The prototype of the localtime () function is below: #include <time.h> struct tm *localtime(const time_t *timer);   Parameters: The

localtime function in C? Read More »

gmtime Function in C

The gmtime function in C converts the calendar time pointed to by the timer into a broken-down time, expressed as UTC. That means it uses the value of the time_t object to fill a tm structure with the values that represent the corresponding time, expressed in Coordinated Universal Time (UTC) or GMT timezone.   Syntax of

gmtime Function in C Read More »

difftime Function in C

The difftime() is a C Library function. It computes the difference between two calendar times (time1 – time0 ) in seconds. The difftime function is present in the <time.h> header file.   Syntax of difftime: The prototype of the difftime function is below: double difftime(time_t time1, time_t time0);   Parameters: The difftime function takes two

difftime Function in C Read More »