libft
Loading...
Searching...
No Matches
Functions
ft_2darray.c File Reference

Utilities for dynamically allocated 2D integer arrays. More...

#include "libft.h"
+ Include dependency graph for ft_2darray.c:

Functions

int ** ft_create_matrix (size_t rows, size_t cols)
 Allocates a 2D array of integers initialized to 0.
 
void ft_free_matrix (int **matrix, size_t rows)
 Frees a 2D array of integers.
 
int ** ft_matrix_copy (int **matrix, size_t rows, size_t cols)
 Creates a deep copy of a 2D array of integers.
 
int ft_print_matrix (int **matrix, size_t rows, size_t cols)
 Prints a 2D array of integers to the standard output.
 
int ** ft_strarr_to_matrix (char **array)
 Converts a NULL-terminated array of strings to a 2D integer array.
 

Detailed Description

Utilities for dynamically allocated 2D integer arrays.

Author
Toonsa
Date
2025/04/05

This file provides creation, duplication, printing, conversion, and cleanup functions for working with dynamically allocated 2D arrays of integers. These tools are useful in grid-based systems, map parsing, and algorithmic simulations.