Quantcast
Channel: Cadence PCB Skill Forum
Viewing all articles
Browse latest Browse all 2157

How to fix the common SKILL error “fprintf/sprintf: format spec. incompatible with data”

$
0
0

For formatted output, SKILL provides the printf, fprintf, and sprintf standard C studio library routines. This error occurs if the data type of a variable does not match the format specifier.

There are two ways to fix this:

  1. Change the format specifier to match the data. In the example, change the format specifier from string (%s) to integer (%d):

              a=5
              printf("a is: %d:\n" a); instead of printf("a is: %s:\n" a)

  1. Change the data to match the format specifier:

              a=” a string”; instead of defining it as a number like in the previous example
              printf("a is: %s:\n" a)

To know about the common output specifiers, click here.

Team PCBTech

Cadence Design Systems


Viewing all articles
Browse latest Browse all 2157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>