当前位置:网站首页>[c语言]二维数组动态分配内存
[c语言]二维数组动态分配内存
2022-07-30 19:53:00 【r77683962】
#include <stdio.h>
#include <stdlib.h>
int main()
{
int **p = 0;
p = (int **)malloc(10 * sizeof(int *));
if (NULL == p)
{
printf("malloc error");
return 0;
}
for(int i=0;i<10;i++)
{
p[i] = (int *)malloc(10 * sizeof(int *));
if (NULL == p[i])
{
printf("malloc2 error");
return 0;
}
}
for(int i=0;i< 10;i++)
{
for(int j=0;j< 10;j++)
{
p[i][j] = i * 10 + j;
printf("%d ", p[i][j]);
}
printf("\n");
}
}
边栏推荐
- How do radio waves transmit information?
- Witness the magical awakening of the mini world in HUAWEI CLOUD
- MindSpore:【JupyterLab】查看数据时报错
- PostgreSQL 14.4如何安装使用
- MySQL分库分表
- 已删除
- ImportError: attempted relative import with no known parent package
- Install Mysql5.7 under Linux, super detailed and complete tutorial, and cloud mysql connection
- Download Win11 how to change the default path?Download Win11 change the default path method
- “数字化重构系统,搞定 CEO 是第一步”
猜你喜欢

推荐系统:AB测试(AB Test)

Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案

Centos7 install mysql8

推荐系统:实时性【特征实时性:客户端实时特征(秒级,实时)、流处理平台(分钟级,近实时)、分布式批处理平台(小时/天级,非实时)】【模型实时性:在线学习、增量更新、全量更新】

M3SDA: Moment matching for multi-source domain adaptation

MySQL分组后取最大一条数据【最优解】

推荐系统:概述【架构:用户/物品特征工程---->召回层---->排序层---->测试/评估】【冷启动问题、实时性问题】

TensorFlow2:概述

推荐系统:评估指标【离线评估指标:RMSE(均方根误差)、AUC、准确率、召回率、F1】【在线评估:A/B测试】【一般要求响应时间<0.5s】

Linux下安装Mysql5.7,超详细完整教程,以及云mysql连接
随机推荐
ImportError: attempted relative import with no known parent package
MySQL六脉神剑,SQL通关大总结
MySQL database master-slave configuration
el-input can only input integers (including positive numbers, negative numbers, 0) or only integers (including positive numbers, negative numbers, 0) and decimals
MindSpore:【语音识别】DFCNN网络训练loss不收敛
LeetCode 0952.按公因数计算最大组件大小:建图 / 并查集
时间复杂度与空间复杂度
Frog jumping steps (recursive and non-recursive) ------- Xiaolele walks the steps
MySQL six-pulse sword, SQL customs clearance summary
KEIL问题:【keil Error: failed to execute ‘C:\Keil\ARM\ARMCC‘】
coming!Dongfang Selection brings goods to the live broadcast of Longjiang agricultural products
el-input 只能输入整数(包括正数、负数、0)或者只能输入整数(包括正数、负数、0)和小数
MySQL Functions (Classic Collection)
青蛙跳台阶(递归和非递归)-------小乐乐走台阶
MindSpore:【模型训练】【mindinsight】timeline的时间和实际用时相差很远
Centos7 install mysql8
Range.CopyFromRecordset method (Excel)
[Node implements data encryption]
What is the difference between a cloud database and an on-premises database?
[hbuilder] cannot run some projects, open the terminal and cannot enter commands