Articles on Trending Technologies

Technical articles with clear explanations and examples

Explain dynamic memory allocation in C with an example

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 13K+ Views

Dynamic memory allocation in C allows programmers to allocate and deallocate memory during program execution rather than at compile time. This provides flexibility to handle varying data sizes efficiently. Syntax void* malloc(size_t size); void* calloc(size_t num, size_t size); void* realloc(void* ptr, size_t new_size); void free(void* ptr); Dynamic Memory Allocation Functions The main functions used for dynamic memory allocation in C are − malloc() − allocates a block of memory in bytes at runtime calloc() − allocates continuous blocks of memory and initializes them to zero realloc() − used to resize previously allocated ...

Read More

Set the style of the rule between columns with CSS

Krantik Chavan
Krantik Chavan
Updated on 15-Mar-2026 226 Views

The CSS column-rule-style property is used to set the style of the rule (line) between columns in a multi-column layout. This property works in conjunction with column-count or column-width to create visual separators between columns. Syntax selector { column-rule-style: value; } Possible Values ValueDescription noneNo rule between columns (default) solidA solid line between columns dashedA dashed line between columns dottedA dotted line between columns doubleA double line between columns ridgeA 3D ridged border grooveA 3D grooved border Example: Dashed Column Rule The following example creates a ...

Read More

Post and Pre incremented of arrays in C language

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 5K+ Views

In C programming, pre and post increment operators can be applied to array elements to modify their values. Understanding how these operators work with arrays is crucial for effective C programming. Syntax // Pre-increment: increment first, then use value variable = ++array[index]; // Post-increment: use value first, then increment variable = array[index]++; Pre-increment vs Post-increment Increment operator (++) − It is used to increment the value of a variable by 1 There are two types of increment operators − pre increment and post increment Pre-increment (++variable): Increment operator is placed before ...

Read More

Set a rounded active and hover button with CSS

Jennifer Nicholas
Jennifer Nicholas
Updated on 15-Mar-2026 1K+ Views

The CSS :hover pseudo-class allows you to add interactive effects when users hover over elements, while the border-radius property creates rounded corners. Combining these with the .active class creates visually appealing navigation buttons with distinct states. Syntax /* Hover effect */ selector:hover { property: value; } /* Active state */ selector.active { property: value; } /* Rounded corners */ selector { border-radius: value; } Example: Rounded Active and Hover Buttons The following example creates a navigation menu with rounded buttons ...

Read More

Matrix row sum and column sum using C program

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 3K+ Views

In C programming, calculating the sum of rows and columns in a matrix is a fundamental operation. This involves iterating through each row to compute row sums and through each column to compute column sums using nested loops. Syntax for(i=0; i

Read More

CSS shorthand property for the flex-grow, flex-shrink, and the flex-basis properties

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 286 Views

The CSS flex property is a shorthand that combines flex-grow, flex-shrink, and flex-basis properties in a single declaration. It controls how flex items grow, shrink, and their initial size within a flex container. Syntax selector { flex: flex-grow flex-shrink flex-basis; } Possible Values PropertyDescriptionDefault Value flex-growHow much the item should grow (number)0 flex-shrinkHow much the item should shrink (number)1 flex-basisInitial size before growing/shrinkingauto Example The following example demonstrates how the flex property affects item sizing within a flex container − ...

Read More

How to print the numbers in different formats using C program?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 839 Views

In C programming, we can print numbers and symbols in different patterns like pyramids and triangles using nested loops. The outer loop controls the rows while inner loops handle spacing and pattern generation. Syntax for(int i = 1; i

Read More

Role of CSS flex-direction property column value

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 246 Views

The CSS flex-direction: column property arranges flex items vertically in a column layout, stacking them from top to bottom. This is the opposite of the default row direction which arranges items horizontally. Syntax selector { display: flex; flex-direction: column; } Example The following example demonstrates how to create a vertical layout using flex-direction: column − .mycontainer { display: flex; flex-direction: ...

Read More

Explain Compile time and Run time initialization in C programming?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 20K+ Views

In C programming, array initialization can occur at two different times: compile time and run time. Understanding the difference between these two approaches is crucial for effective memory management and program design. Syntax // Compile time initialization type array_name[size] = {value1, value2, ..., valueN}; // Run time initialization type array_name[size]; // Values assigned during program execution Compile Time Initialization In compile time initialization, array values are specified directly in the source code when the array is declared. The compiler allocates memory and assigns values during the compilation process − #include ...

Read More

Shorthand CSS property for flex-direction and flex-wrap

George John
George John
Updated on 15-Mar-2026 333 Views

The CSS flex-flow property is a shorthand property that combines flex-direction and flex-wrap into a single declaration. This property allows you to control both the direction of flex items and whether they wrap to new lines. Syntax selector { flex-flow: flex-direction flex-wrap; } Possible Values ValueDescription flex-directionSets the direction: row, row-reverse, column, column-reverse flex-wrapSets wrapping: nowrap, wrap, wrap-reverse Example: Column Direction with Wrapping The following example uses flex-flow: column wrap to arrange items vertically with wrapping − ...

Read More
Showing 20891–20900 of 61,298 articles
Advertisements