2022年9月11日

Numpy

摘要: import numpy as np a = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]]) col_r1 = a[:, 1] col_r2 = a[:, 1:2] print(col_r1, col_r1.shape) # Prints "[ 2 6 阅读全文

posted @ 2022-09-11 22:41 squarebky 阅读(31) 评论(0) 推荐(0)

2022年1月15日

malloc函数用法

摘要: int *p = malloc( 10 * sizeof(int) );//直接预订10个整数大小的空间给p//free(p) int *a; a=malloc(3*sizeof(int));//把3个整数大小的空间赋给地址a//free(a) 用后记得free() 若内存不足,则p、a等于null 阅读全文

posted @ 2022-01-15 02:08 squarebky 阅读(62) 评论(0) 推荐(0)

C语言指针

摘要: #include <stdio.h> int main() { int data[2] = {5, 3}; printf("%d\n",data); //打印data第一个元素的地址 printf("%d\n",&data[0]); //同上,打印data第一个元素的地址printf("%d\n", 阅读全文

posted @ 2022-01-15 01:54 squarebky 阅读(16) 评论(0) 推荐(0)

2022年1月11日

数据结构与->

摘要: struct person;//person为某一结构 int *ap;*ap=&person;//ap是person的地址 person为某一结构,gender为该结构下的元素,则·有person.gender 以下三项: person.gender ap->gender (*ap).gender 阅读全文

posted @ 2022-01-11 23:57 squarebky 阅读(36) 评论(0) 推荐(0)

导航