Articles on Trending Technologies

Technical articles with clear explanations and examples

What does int argc, char *argv[] mean in C/C++?

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 8K+ Views

In C programming, int argc and char *argv[] are parameters of the main function that allow your program to receive command-line arguments when executed. argc stands for argument count and argv stands for argument vector (or argument values). Syntax int main(int argc, char *argv[]) { // Program code return 0; } Parameters argc − An integer representing the number of command-line arguments passed to the program (including the program name itself) argv[] − An array of character pointers (strings) containing the actual command-line arguments ...

Read More

How to draw a text string image horizontally by using imagestring() function in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 1K+ Views

The imagestring() function is a built-in PHP function used to draw a text string horizontally on an image. It requires the GD extension to be enabled for image manipulation. Installation: Ensure PHP GD extension is installed and enabled in your PHP configuration. Syntax bool imagestring($image, $font, $x, $y, $string, $color) Parameters The imagestring() function accepts six parameters − $image − An image resource created by functions like imagecreate() or imagecreatetruecolor(). $font − Font size ranging from 1 to 5 for built-in fonts (1 is smallest, 5 is largest). $x ...

Read More

How to set the tile image for filling using imagesettile() function in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 451 Views

The imagesettile() function is an inbuilt function in PHP that sets the tile image for filling operations. It defines the image to be used by all-region filling functions like imagefill() and imagefilledpolygon() when filling with the special color IMG_COLOR_TILED. A tile is an image that fills an area with a repeated pattern. Any GD image resource can be used as a tile to create seamless patterns across larger areas. Syntax bool imagesettile($image, $tile) Parameters imagesettile() accepts two parameters − $image − The image resource (canvas) where the tile will be applied ...

Read More

Is C++0x Compatible with C?

Srinivas Gorla
Srinivas Gorla
Updated on 15-Mar-2026 191 Views

C++0x (later standardized as C++11) is not fully compatible with C, just as previous C++ standards were not. While C++ was designed to be largely compatible with C, there are several key differences that prevent full compatibility. Syntax // C code that may not compile in C++ // or behaves differently Key Compatibility Issues Example 1: Implicit void* Conversion In C, you can implicitly convert from void* to other pointer types. C++ requires explicit casting − #include #include int main() { /* This works in C but not in C++ */ ...

Read More

How to set the style for line drawing using imagesetstyle() function in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 262 Views

The imagesetstyle() function is an inbuilt PHP function used to set custom styles for line drawing. It works with all line drawing functions like imagepolygon() and imageline() to create dashed, dotted, or patterned lines. Syntax bool imagesetstyle(resource $image, array $style) Parameters imagesetstyle() takes two parameters − $image − The image resource to work on, created by functions like imagecreate() or imagecreatetruecolor(). $style − An array of pixel colors that defines the line pattern. Each element represents one pixel in the repeating pattern. Return Value Returns True on success or ...

Read More

How to rotate an image with a given angle using imagerotate() function in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 1K+ Views

The imagerotate() function is an inbuilt PHP function used to rotate an image by a specified angle in degrees. This function is part of the GD extension and provides a simple way to perform image rotation operations. Note: This function requires the GD extension to be enabled. Install it using: sudo apt-get install php-gd (Ubuntu/Debian) or enable it in php.ini by uncommenting extension=gd. Syntax resource imagerotate($image, $angle, $bgd_color, $ignore_transparent = 0) Parameters The imagerotate() function accepts four parameters ? $image − An image resource created by functions like imagecreatetruecolor(), ...

Read More

How to get or set the resolution of an image using imageresolution() function in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 1K+ Views

The imageresolution() function is an inbuilt PHP function that is used to get or set the resolution of an image in dots per inch (DPI). If no optional parameters are given, it returns the current resolution as an indexed array. If optional parameters are provided, it sets both the width and height resolution. The resolution is only used as meta information when images are read from and written to formats that support this information (currently PNG and JPEG). It does not affect drawing operations. The default resolution for new images is 96 DPI. Syntax mixed imageresolution(resource ...

Read More

How to copy the palette from one image to another using imagepalettecopy() function in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 223 Views

The imagepalettecopy() function is an inbuilt PHP function used to copy the color palette from one image resource to another. This function is particularly useful when working with palette-based images where you want to share the same color scheme between multiple images. Syntax void imagepalettecopy(resource $destination, resource $source) Parameters The imagepalettecopy() function accepts two parameters ? $destination − Specifies the destination image resource that will receive the copied palette. $source − Specifies the source image resource from which the palette will be copied. Return Value This function does not ...

Read More

How can I write in order with for loop or while loop?

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 332 Views

In C programming, we can create ordered patterns using for loops or while loops. This example demonstrates how to generate a specific numerical pattern where each line contains repeating digits based on the line number. Syntax for(initialization; condition; increment) { // loop body } while(condition) { // loop body increment; } Method 1: Using For Loop This approach uses nested for loops to create a pattern where each line displays the line number followed by repeating 0s and 1s − ...

Read More

How to draw an open polygon using the imageopenpolygon() function n PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 461 Views

The imageopenpolygon() function is an inbuilt PHP function used to draw an open polygon on a given image. Unlike closed polygons, open polygons do not connect the last point back to the first point, creating an incomplete shape. Syntax bool imageopenpolygon(resource $image, array $points, int $num_points, int $color) Parameters The imageopenpolygon() function accepts four parameters: $image − Specifies the image resource to work on. $points − Specifies the points of the polygon as an array of x, y coordinates. $num_points − Specifies the ...

Read More
Showing 22151–22160 of 61,297 articles
Advertisements