首页 > 系统相关 >LabWindows/CVI Scan( )函数

LabWindows/CVI Scan( )函数

时间:2023-10-12 11:25:54浏览次数:40  
标签:10 Scan CVI LabWindows printf date total id

背景介绍

Scan()可以将字符串按照用户 formatString 格式说明分解成多个组件。最多可以分解29个组件。

Scan()很强大且复杂,使用起来容易出错,但它却被频繁使用。

Scan()函数

函数头文件:#include <formatio.h>

函数原型:int Scan (void *Source, char Format_String[], ...);

将字符串:2023-10-10 10:09:00.100,1024,5.20,gbk2313,90.00 分成成字符串、整型、浮点型,即date="2023-10-10 10:09:00.100",id=1024,price=5.20,encode="gbk2312",total=90.00

/* 部分代码 */
char date[24] = {0}, encode[128] = {0};
int id = 0;
double price = 0, total = 0;
const char *buffer = "2023-10-10 10:09:00.100,1024,5.20,gbk2313,90.00";
Scan(buffer, "%s>%s[t44],%d,%f,%s[t44],%f", date, &id, &price, encode, &total);
printf("buffer=\"2023-10-10 10:09:00.100,1024,5.20,gbk2313,90.00\"\n");

printf("date=%s\n", date);
printf("id=%d\n", id);
printf("price=%f\n", price);
printf("encode=%s\n", encode);
printf("total=%f\n", total);

标签:10,Scan,CVI,LabWindows,printf,date,total,id
From: https://www.cnblogs.com/caojun97/p/17753855.html

相关文章

  • Scanner类方法的使用
    classDemos01{publicstaticvoidmain(String[]args){//创建一个扫描器对象,用于接收键盘数据Scannerscanner=newScanner(System.in);//System.in是输入的意思System.out.println("使用next方式接收:");//判断用户有没有输入字串......
  • Scanner写法
    Scanner有什么用Scanner类用于获取用户的输入基本语法Scanners=newScanner(System.in)//(Scanners=)这部分可以在输入后半部分后通过alt+ender快速输入通过Scanner类的next()或nextLine()获取输入的字符串一般使用hasNext()或hasNestLine()判断是否还有输入的数据关......
  • closemuRUnlockIfHeldByScan
     2023/10/0904:24:37tick[mysql]2023/10/0904:24:37packets.go:37:readtcp192.100.1.15:60029->47.113.12.126:3309:wsarecv:Aconnectionattemptfailedbecausetheconnectedpartydidnotproperlyrespondafteraperiodoftime,orestablishedconne......
  • 解决Windows下pip安装bertopic报错:Failed building wheel for hdbscan
    在安装bertopic的过程中,遇到了Failedbuildingwheelforhdbscan,我先去网站:https://www.lfd.uci.edu/~gohlke/pythonlibs/#hdbscan下载了hdbscan‑0.8.28‑cp310‑cp310‑win_amd64.whl,并且用pip进行了本地安装,依然报错。然后仔细阅读报错信息,发现是build报错,我在Linux系统下并......
  • printf 和scanf的用法(最终版)
    一 格式化输入函数scanfscanf函数的功能是格式化输入任意数据列表,其一般调用格式为:scanf(格式控制符,地址列表)【说明】(1)地址列表中给出各变量的地址,可以为变量的地址,以&开头,也可以为数组,字符串的首地址。(2)格式控制符由%和格式符组成,作用......
  • 一 . 格式化输出函数 scanf
    scanf函数的功能是格式化输出任意数据列表,其一般调用格式为:scanf(格式控制符,地址列表)。【说明】(1)地址列表中给出各变量的地址,可以为变量的地址,以&开头,也可以为数组,字符串的首地址。(2)格式控制符由%和格式符组成,作用是将要输入的字符按指定的格式输入如%d,%c......
  • scanf&printf
         ......
  • printf函数 和 scangf函数 的格式符
       ......
  • printf scanf
               ......
  • redis中各种scan命令学习
    转自:https://blog.csdn.net/qq_40399646/article/details/109034331,这个博客讲的非常好http://jinguoxing.github.io/redis/2018/09/04/redis-scan/1.介绍keys命令可以列出所有满足特定正则字符串规则的key。但它没有offset、limit参数,会一次性返回所有满足条件的key,是遍历......