What is the difference between scanning and sscanf

When to receive the result of the instrument, I find RS give us two function,.

one:

If ((status = viRead (instrSession, buf, 50, & retCnt))<>
return the situation;
If (Scan (buf, "%s > f", MaxBurstPower)! = 1).
Return MB8820B_status;

Return MB8820B_status;
       
}

Two:
If (strcmp (rdBuf, "NAN")! = 0)
sscanf (rdBuf, "% lf", MaxBurstPower);
can someone tell me the difference between them, if use scan() results of the instrument, the top is good?

Scan and sscanf are very similar in usage (infact most of the formatted string can be passed from one statement to another). The main difference is that Scan comes form a library owner of NOR, so if you want to write portable code across several compilers do not use it. I find Scan more powerful in some special occasions, for example when scanning with fixed number of bytes per numbers and so forth. The same facilities in my opinion can be obtained with more difficult way sscanf.

Tags: NI Software

Similar Questions

Maybe you are looking for