Articles on Trending Technologies

Technical articles with clear explanations and examples

Printing Heart Pattern in C

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 10K+ Views

In this program we will see how to print heart shaped pattern in C. The heart shape pattern consists of two rounded peaks at the top and an inverted triangle forming the base. *** *** ***** ***** *********** ********* ******* ***** *** * Now if we analyze this pattern, we can find different sections. The base of the heart is an inverted triangle; ...

Read More

fork() in C

Vrundesha Joshi
Vrundesha Joshi
Updated on 15-Mar-2026 4K+ Views

In this section we will see what is the fork system call in C. This fork system call is used to create a new process. This newly created process is known as child process. The current process which is creating another child process is called the parent process. A child process uses the same program counter, CPU register, same files that are used by the parent process. Syntax #include #include pid_t fork(void); Return Value The fork() does not take any parameter, it returns integer values. It may return three types ...

Read More

Assertions in C/C++

Aman Kumar
Aman Kumar
Updated on 15-Mar-2026 670 Views

An assertion in C is a debugging tool that checks if a condition is true during program execution. When an assertion fails, the program displays an error message and terminates immediately. This helps catch programming errors early in the development process. In C programming, assertions are implemented using the assert() macro defined in the header file. The macro evaluates an expression and aborts the program if the expression is false. Syntax #include assert(expression); Parameters: expression − A condition that should be true. If it evaluates to false (0), the program terminates ...

Read More

How to define a route differently if a parameter is not an integer?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 708 Views

In Laravel routing, you can validate route parameters to ensure they meet specific criteria, such as ensuring a parameter is not an integer. This is accomplished using Laravel's built-in route parameter validation methods. Basic Route Parameters Route parameters are defined within curly braces and can contain alphanumeric characters and underscores ? Route::get('/user/{myid}', function ($myid) { // }); You can also define multiple parameters in a single route ? Route::get('/students/{post}/feedbacks/{feedback}', function ($postId, $feedbackId) { // }); Using where() Method The where() method ...

Read More

Print \"Hello World\" in C/C++ without using header files

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 15-Mar-2026 2K+ Views

In C/C++, we typically use header files to access standard library functions. The printf() function is declared in the "stdio.h" header file and is used to print data to the console. However, it's possible to print "Hello World" without including any header files by declaring the function prototype ourselves. Syntax int printf(const char *format, ...); Method 1: Using printf() Declaration in C In C, we can declare the printf() function prototype directly in our program without including stdio.h. The compiler will link to the standard library automatically − int printf(const char *format, ...

Read More

How to insert raw data in MySQL database in Laravel?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 6K+ Views

In Laravel, you can insert raw data into MySQL database tables using the Query Builder tool. This requires including the Illuminate\Support\Facades\DB facade or adding use DB; at the top of your controller. Prerequisites: Ensure Laravel is installed and a MySQL database connection is configured in your .env file. Assume we have created a table named students using the CREATE statement as shown below − CREATE TABLE students( id INTEGER NOT NULL PRIMARY KEY, ...

Read More

Implement your own itoa() in C

Nitya Raut
Nitya Raut
Updated on 15-Mar-2026 2K+ Views

In C programming, the itoa() function converts an integer to a string representation. However, itoa() is not part of the C standard library. Here we'll implement our own version using both the sprintf() approach and a manual conversion method. Syntax char* itoa(int value, char* str, int base); Method 1: Using sprintf() The sprintf() function formats and stores data in a string buffer instead of printing to console − #include #include char* my_itoa_sprintf(int number, char* str) { sprintf(str, "%d", number); return str; ...

Read More

Heap overflow and Stack overflow in C

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 6K+ Views

In C programming, memory management involves two primary areas: the heap and the stack. Both can experience overflow conditions that lead to program crashes or undefined behavior. Understanding these overflows is crucial for writing robust C programs. Heap Overflow The heap is a region of memory used for dynamic allocation. Functions like malloc(), calloc(), and realloc() allocate memory from the heap at runtime. Heap overflow occurs when the program exhausts available heap memory. This typically happens in two scenarios − Allocating Excessive Memory Attempting to allocate extremely large amounts of memory can cause heap overflow ...

Read More

How to call a controller function inside a view in Laravel 5?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 4K+ Views

In Laravel, you can call controller methods directly within views using several approaches. While this is generally discouraged in favor of proper MVC separation, Laravel provides multiple ways to achieve this when necessary. Method 1: Direct Static Call The simplest approach is to call the controller method directly using its fully qualified namespace − Method 2: Using Import Statement You can import the controller class first, then call the method − Method 3: Blade Template Syntax For Blade templates, you can use double curly braces − ...

Read More

How to get the contents of the HTTP Request body in Laravel?

Shilpa Kalangutkar
Shilpa Kalangutkar
Updated on 15-Mar-2026 12K+ Views

In Laravel, you can retrieve HTTP request body contents using the Illuminate\Http\Request class. This class provides several methods to access input data, cookies, and files from HTTP requests in different formats. HTTP Request Body name: John Doe email: john@example.com age: 25 Laravel Request Methods Using $request->all() Method The all() method retrieves all input data from the request and returns it as an array − Output Array ( ...

Read More
Showing 21971–21980 of 61,297 articles
Advertisements