Aman Kumar has Published 94 Articles

How can we return multiple values from a function in C/C++?

Aman Kumar

Aman Kumar

Updated on 18-Jun-2025 18:38:24

28K+ Views

In C or C++, we cannot return multiple values from a function directly. In this Article, we will see how to use some trick to return more than one value from a function. Returning Multiple Values from a Function We can return multiple values from a function by using the ... Read More

Heap overflow and Stack overflow

Aman Kumar

Aman Kumar

Updated on 18-Jun-2025 18:31:25

636 Views

Heap and stack overflows are both types of buffer overflows that occur when a program attempts to write data beyond the allocated boundary of a buffer. Heap Overflow Heap is used to store dynamic variables. It is a region of process’s memory. malloc(), calloc(), resize() all these inbuilt functions are ... Read More

Returning multiple values from a C++ function

Aman Kumar

Aman Kumar

Updated on 12-Jun-2025 17:51:03

9K+ Views

In C++, we cannot return multiple values from a function directly. But, by using some methods (i.e., techniques), we can return multiple values from a function. How to Return Multiple Values from a Function? A function can return only one value using the return statement. We can return multiple values ... Read More

Print leading zeros with C++ output operator

Aman Kumar

Aman Kumar

Updated on 12-Jun-2025 17:44:24

7K+ Views

Here we will see how to print leading zeros as output in C++. We know that if we directly put some zeros before some numeric values, then all zeros are discarded, and only exact numbers are printed.Printing Leading Zeros with C++ Output Operator We can manipulate the output sequence in ... Read More

What is the purpose of a function prototype in C/C++?

Aman Kumar

Aman Kumar

Updated on 12-Jun-2025 14:58:45

6K+ Views

In this article, we will explore the purpose of using function prototypes in C or C++. What are Function Prototypes? The function prototypes tell the compiler about the number of arguments and the required data types of function parameters; they also tell the compiler about the return type of the ... Read More

How to use the PI constant in C++?

Aman Kumar

Aman Kumar

Updated on 10-Jun-2025 18:53:08

20K+ Views

The Pi is a special mathematical value, approximately 3.14159, that is often used in calculations related to circles and geometry. In C++, we need to understand how to access and use this constant in our programs. In this article, we will show how to use the PI constant ... Read More

Parsing Command Line Parameters in C++ Program

Aman Kumar

Aman Kumar

Updated on 10-Jun-2025 18:52:52

327 Views

In this article, we will learn how to pass command line parameters in C++. The command line argument is a parameter that is passed to a program when it is invoked by the command line or terminal. Parsing Command Line Parameters in C++ In C++, we can pass the command ... Read More

Ternary operator ?: vs if…else in C/C++

Aman Kumar

Aman Kumar

Updated on 09-Jun-2025 18:40:42

770 Views

In C/C++, both ternary operator and if-else statements are conditional statements: A condition statement expresses the relationship between two ideas or events. Where one is dependent on the other. If the condition is true, the if statement will return; otherwise, the else statement will return. Ternary Operator We know that ... Read More

C Program to find sum of two numbers without using any operator

Aman Kumar

Aman Kumar

Updated on 09-Jun-2025 18:40:20

1K+ Views

In this article, we Implement the C program to find the sum of two numbers without using any Operator. Find Sum of Two Numbers Without Using Any Operator in C This problem is tricky. To solve this problem we are using the minimum width features of the printf() statement. We ... Read More

Execution of printf with ++ operators in C

Aman Kumar

Aman Kumar

Updated on 09-Jun-2025 18:40:02

2K+ Views

In the C programming language, the printf() function is used to print ("character, string, float, integer, octal, and hexadecimal values") to the output screen. To demonstrate the value of an integer variable, we use the printf() function with the %d format specifier. Let's see a C statement and guess the ... Read More

Advertisements