⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 varray.sl

📁 一个C格式的脚本处理函数库源代码,可让你的C程序具有执行C格式的脚本文件
💻 SL
字号:
% This file shows how to use the varray-module to treat a file as an% array of objects.import ("varray");% First of all, create an array of doublesstatic variable x = [1:1000.0:1.0];% and write it to diskstatic variable file = "varray_example.dat";static variable fp = fopen (file, "wb");if (fp == NULL){   () = fprintf (stderr, "failed to open %s\n", file);   exit (1);}if ((-1 == fwrite (x, fp))    or (-1 == fclose (fp))){   () = fprintf (stderr, "Failed to write x\n");   exit (1);}% Now associate an array with the filevariable y = mmap_array (file, 0, _typeof(x), length(x));if (length (where (y != x))){   fprintf (stderr, "mmap_array has failed\n");   exit (1);}y = 0;				       %  remove the mapexit (0);

⌨️ 快捷键说明

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