
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 2300 of 2651

2K+ Views
Stack and heap are used to store variables during the execution of the program and it also get destroyed.Global data structures or global variables are not consumed by stack or heap. They basically allocated in a fixed memory block, which remains unchanged.int a[10]; // located in a fixed memory block int main() { int main() { float *ptr = (int *)malloc(sizeof(float)10.0)); //use heap. } }

22K+ Views
Dereferencing is used to access or manipulate data contained in memory location pointed to by a pointer. *(asterisk) is used with pointer variable when dereferencing the pointer variable, it refers to variable being pointed, so this is called dereferencing of pointers. int main() { int a = 7, b ; int *p; // Un-initialized Pointer p = &a; // Stores address of a in ptr b = *p; // Put Value at ptr in b }Here, address in p is basically address of a variable.Complete tutorial on dereferencing: C++ Dereferencing

633 Views
Both languages (C and C++) support void pointers, but their behaviour is different. In C, a void pointer can be directly assigned to any other pointer type without the need for a typecast. However, in C++, assigning a void pointer to any other pointe type require an explicit typecast. In this article, we will learn the differences between void pointers in C and C++.. Void Pointer in C A void pointer (also called a generic pointer) in C is a special type of pointer that can point to any data type, but doesn’t have any type by itself. It ... Read More

1K+ Views
The character constant is a constant that is enclosed in a single quote (' '). It represents the integer value (i.e., ASCII) of the character. In C programming language, the data type of character constant is an integer (represented by int) and it needs 4 bytes to store a character constant. For example: 'A', '1', '3', etc., are the character constants. In C++, the data type for character constants is char and it needs only 1 byte to store a character constant. Here are the size of different data types in bytes: ... Read More

396 Views
In C, you cannot use a function call on the left side of an assignment if it returns a value because function calls return non-assignable values. For example, function_name() = value; However, if the function returns a pointer, you can dereference it to assign a value. For example, *function_name() = value; In C++, the same rule applies. You can use the returned reference/pointer on the left side to modify the original variable which is valid only if it returns a reference. function_name() = value; Note: References allow direct access to variables, and pointers allow indirect access via dereferencing. ... Read More

9K+ Views
In this program we will see how to print heart shaped pattern in C. The heart shape pattern will be look like thisNow if we analyze this pattern, we can find different section in this pattern. The base of the heart is an inverted triangle; the upper portion has two different peaks. Between these two peaks there is a gap. To make this pattern we have to manage these parts into our code to print the pattern like this.Example Live Demo#include int main() { int a, b, line = 12; for (a = line/2; a

20K+ Views
A string is a sequence of characters used to store information as text. In C++, strings are represented as array of characters using the std::string class. In this article, we will learn what is an array of strings in C++, how to declare and initialize it, and how to access its elements. C++ Array of Strings Array of strings refer to an array where each element is a string. Just like a normal array, we can define an array of strings by specifying the data type as std::string and the size of the array inside square brackets. To initialize ... Read More

9K+ Views
In this section we will see how to create and use complex numbers in C++. We can create complex number class in C++, that can hold the real and imaginary part of the complex number as member elements. There will be some member functions that are used to handle this class.In this example we are creating one complex type class, a function to display the complex number into correct format. Two additional methods to add and subtract two complex numbers etc.Example Live Demo#include using namespace std; class complex { int real, img; public: complex() { ... Read More

778 Views
When you want to write a program in C++, your compiler (like GCC) converts your code into computer language. While doing this, GCC offers some special functions called built-in functions. The built-in functions are predefined functions by the compiler itself, but not provided by any standard library. The GCC compiler provides several built-in functions. Some of these functions are listed below: __builtin_popcount(x) __builtin_parity(x) __builtin_clz(x) __builtin_ctz(x) The __builtin_popcount(x) Function This builtin function is used to count the number of 1s in an integer ... Read More

4K+ Views
Wide Characters Wide characters are similar to character datatype. The main difference is that char takes 1-byte space, but wide character takes 2-bytes (sometimes 4-byte depending on compiler) of space in memory. For 2-byte space wide character can hold 64K (65536) different characters. So the wide char can hold UNICODE characters. The UNICODE values are international standard which allows for encoding for characters virtually for any character of any language. Example 1: Size of a single wide character This program demonstrates how to declare a single wide character using wchar_t to print its value and memory size. #include using namespace ... Read More