C – Page 2 – POFTUT

strcat() Function Tutorial In C and C++ with Examples

strcat() Function Tutorial In C and C++ with Examples

strcat() function is mainly used to copy or add string or char arrays in C and C++ programming languages. In general strcat() function will copy or add given string or char array into the destination string or char array. strcat() Function Syntax The strcat() function has the following syntax. The strcat() function is provided by … Read more

strlen() Function In C and C++ Tutorial with Examples

strlen() Function In C and C++ Tutorial with Examples

C and C++ programming languages provide the strlen() function in order to calculate or return the size of the given string or char array. String and char array is the same data type in C and C++ which simply a character array. strlen() function provided from the string.h header or library. strlen() Function Syntax strlen() … Read more

calloc() Function Tutorial In C and C++ To Allocate Memory

calloc() Function Tutorial In C and C++ To Allocate Memory

calloc() function is used in C and C++ programming languages in order to allocate memory. calloc() function is used to allocate memory for the given variable type for the given count. After allocation initializes the allocated memory area by filling zeros. calloc() Function Syntax calloc() function has the following syntax where it accepts two parameters. … Read more

scanf() Function In C and C++ To Read Input From Command Line

scanf() Function In C and C++ To Read Input From Command Line

scanf() function is used to read input from the console or standard input of the application in C and C++ programming language. scanf() function can read different data types and assign the data into different variable types. The input data can be read in different formats by using format specifiers. The standard input can be … Read more

strstr() Function in C and C++ Tutorial with Examples

strstr() Function in C and C++ Tutorial with Examples

C and C++ programming languages provide the strstr() function in order to find or match a string in another string. For example, we can search pof string inside the poftut.com and find matches and return the matching index number. strstr() Function Syntax strstr() function has the following syntax where two strings are provided as parameter. … Read more

Switch Case Statement in C/C++ Tutorial with Examples

Switch Case Statement in C/C++ Tutorial with Examples

C/C++ programming languages provides switch … case statement for selection according to given switch state. switch  … case can be used for different cases in order to control the flow of the application. Syntax switch … case has the following syntax. switch(EXPRESSION) {  case CONDITION1:    CASE1_CODE; break;  case CONDITION2:    CASE1_CODE; break; … default: … Read more

C++ Constructor Tutorial with Examples

C++ Constructor Tutorial with Examples

A constructor is used in object-oriented programming languages in order to initialize an object which will be created from a class type. In C++ constructor is automatically called in order to initialize an object in different ways. What Is Constructor? A constructor is defined inside the class with the same name as the class. The … Read more

What Is Constant Variable In Programming?

What Is Constant Variable In Programming?

Variables are a very important part of programming. We define variables in order to store data in simple or complex forms. Constant is used to create a variable which value can not be changed. This may seem a bit strange but in some cases, it can be very helpful. Constant Variable In general constant variable … Read more

How To Print/Get Today Date and Time In JavaScript, C/C++, Python, C#, Java, PHP, PowerShell, Excel (VBScript) ?

How To Print/Get Today Date and Time In JavaScript, C/C++, Python, C#, Java, PHP, PowerShell, Excel (VBScript) ?

While developing applications date and time operations are very important. A lot of different data and record is bind to a date or time. We can also use the only date which specifies the year, month and day or time which specifies the hour, minute, second. All popular programming languages provides date and time functions … Read more

C/C++ atoi() Function Tutorial – Convert String To Integer

C/C++ atoi() Function Tutorial - Convert String To Integer

C and C++ programming languages provide string or character to integer conversion with the atoi() function. atoi simply the short form of chArTOInteger where the uppercase letters stand side by side. The function is provided by the standard library which means we do not need to install an extra library or package. atoi() Function Syntax … Read more