Articles on Trending Technologies

Technical articles with clear explanations and examples

Count spaces, uppercase and lowercase in a sentence using C

Arnab Chakraborty
Arnab Chakraborty
Updated on 15-Mar-2026 1K+ Views

In C programming, counting different types of characters in a string is a common task. This involves analyzing each character to determine if it's uppercase, lowercase, a digit, whitespace, or a special character. Syntax for (int i = 0; str[i] != '\0'; i++) { // Check character type using ASCII values if (str[i] >= 'A' && str[i] = 'a' && str[i] = '0' && str[i] = 'A' && str[i] = 'a' && str[i] = '0' && str[i]

Read More

How to convert a string to a integer in C

Pythonista
Pythonista
Updated on 15-Mar-2026 945 Views

In C programming, converting a string to an integer is a common task that can be accomplished using several built-in functions. The most commonly used functions are atoi(), strtol(), and sscanf(). Syntax int atoi(const char *str); long strtol(const char *str, char **endptr, int base); int sscanf(const char *str, const char *format, ...); Method 1: Using atoi() Function The atoi() function converts a string to an integer. It stops reading when it encounters a non-digit character − #include #include int main() { char str[] = "12345"; ...

Read More

How to check antialias functions be used or not by using imageantialias() function in PHP?

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

The imageantialias() function is an inbuilt PHP function that enables or disables antialiasing for drawing operations. It activates fast drawing anti-aliased methods for lines and wired polygons, working only with true-color images without alpha component support. Syntax bool imageantialias($image, $enabled) Parameters The imageantialias() function takes two parameters: $image − A GdImage object or image resource created by image creation functions like imagecreatetruecolor(). $enabled − A boolean value that enables (true) or disables (false) antialiasing. Return Value Returns true on success or false on failure. Example Here's how ...

Read More

List of Common Reasons for Segmentation Faults in C/C++

Ramu Prasad
Ramu Prasad
Updated on 15-Mar-2026 5K+ Views

The main reason for segmentation fault is accessing memory that is either not initialized, out of bounds for your program or trying to modify string literals. These may cause a segmentation fault though it is not guaranteed that they will cause a segmentation fault. Here are some of the common reasons for segmentation faults − Accessing an array out of bounds Dereferencing NULL pointers Dereferencing freed memory Dereferencing uninitialized pointers Incorrect use of the "&" (address of) and "*" (dereferencing) operators Improper formatting specifiers in printf and scanf statements Stack overflow Writing to read-only memory Common ...

Read More

How to apply a 3×3 convolution matrix using imageconvolution() in PHP?

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

The imageconvolution() function is an inbuilt function in PHP that applies a 3×3 convolution matrix to an image using coefficients and offset values. This function is commonly used for image filtering effects like blur, sharpening, and edge detection. Syntax bool imageconvolution($image, $matrix, $div, $offset) Parameters The imageconvolution() function accepts four parameters: $image − A GD image resource created using image creation functions like imagecreatetruecolor() $matrix − A 3×3 array containing float values representing the convolution kernel $div − The divisor used for normalization ...

Read More

How does the compilation/linking process work in C/C++?

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

The compilation of a C program involves several distinct phases that transform source code into an executable program. Understanding this process helps debug compilation errors and optimize build workflows. Compilation Process Overview Source Code (main.c) Preprocessor (main.i) Compiler (main.s) Assembler (main.o) Linker (executable) ...

Read More

How to apply a gamma correction to a Graphics Draw (GD) image in PHP?

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

The imagegammacorrect() function is an inbuilt PHP function that applies gamma correction to a Graphics Draw (GD) image. Gamma correction adjusts the brightness and contrast of an image by modifying the relationship between input and output pixel values. Syntax bool imagegammacorrect(resource $image, float $inputgamma, float $outputgamma) Parameters The imagegammacorrect() function takes three parameters ? $image − The image resource to apply gamma correction to $inputgamma − The input gamma value (typically between 0.1 and 10.0) $outputgamma − The output gamma value (typically between 0.1 and 10.0) Return Values Returns ...

Read More

How to enable or disable interlace using imageinterlace() function in PHP?

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

The imageinterlace() function is a built-in PHP function used to enable or disable interlacing in images. Interlacing encodes bitmap images so that partially loaded images display as degraded copies of the entire image, allowing users to see portions as the image loads progressively. Non-interlaced JPEGs appear line-by-line during loading, while interlaced images show a blurred version that becomes clearer. This function controls this behavior by setting the interlace parameter to 1 (enable) or 0 (disable). Syntax int imageinterlace(resource $image, int $interlace) Parameters The imageinterlace() function accepts two parameters: ...

Read More

What is a segmentation fault in C/C++?

Priya Pallavi
Priya Pallavi
Updated on 15-Mar-2026 10K+ Views

A segmentation fault (commonly called "segfault") occurs when your program attempts to access an area of memory that it is not allowed to access. In other words, when your program tries to access memory that is beyond the limits that the operating system allocated for your program. Segmentation faults are one of the most common runtime errors in C programming and cause the program to terminate immediately with an error message. Common Causes Seg faults are mostly caused by pointers that are − Used without being properly initialized. Used after the memory they point to ...

Read More

How to set a single pixel using imagesetpixel() function in PHP?

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

The imagesetpixel() function is an inbuilt PHP function used to set a single pixel at a specified coordinate in an image. It's part of the GD library extension and requires the image to be an image resource. Installation: Ensure the GD extension is enabled in your PHP installation. Most PHP installations include it by default. Syntax bool imagesetpixel(resource $image, int $x, int $y, int $color) Parameters The imagesetpixel() function accepts four parameters: $image − The image resource to work on, created by functions like imagecreate() or imagecreatefromjpeg(). $x − ...

Read More
Showing 22141–22150 of 61,299 articles
Advertisements