arraystatic.c

来自「You will write a program for calculating」· C语言 代码 · 共 20 行

C
20
字号
#include "array.h"// Default array size (if not defined like gcc -DARRAY_SIZE=100)#ifndef ARRAY_SIZE#define ARRAY_SIZE 20#endifint main(void) {	// Create a static array	int array[ARRAY_SIZE];	// Fill it with numbers	for (size_t i = 0; i < ARRAY_SIZE; ++i) array[i] = i + 1;	// Print the contents	arrayPrintN(array, ARRAY_SIZE);	// Add an end marker in the middle and print again	array[ARRAY_SIZE / 2] = -1;	arrayPrintUntil(array, -1);	// The block ends, array goes out of scope and is automatically freed}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?