Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the formatted output and escape characters of printf in vxworks

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces what is the formatted output and escape characters of printf in vxworks. The article is very detailed and has certain reference value. Interested friends must read it!

Printf ()-writes a format statement to the standard output device. Returns the number of characters output after a successful output; otherwise, a negative value is returned

The general form is printf (",)

The format string consists of two parts: one is a normal character, which will be output as is, and the other is a format character, starting with "%" followed by one or more format characters to determine the format of the output. A parameter table is a series of parameters that need to be output, and the number of parameters must be the same as the number of parameters of the formatted string. The parameters must be separated by "," and correspond one by one in order, otherwise unexpected errors will occur.

Related functions printErr (), fprintf (), sprintf (), snprintf (), kprintf (), printExc ()

Fprintf ()-outputs formatted statements to stream

PrintErr ()-outputs formatted statements to standard error stream

Sprintf ()-outputs formatted statements to buffer

Snprintf ()-outputs a formatted statement of a certain length to buffer

Kprintf ()-outputs formatted statements to target console using the polling mode of serial IO, which can be called in ISR

PrintExc ()-print exception messages

American National Standard for Information Systems Programming Language-C, ANSI X3.159-1989: Input/Output (stdio.h)

ANSI defines more standards, which are supported by every OS or compiler vendor.

In addition, some letters are defined in C with "\" to indicate common ASCII characters that cannot be displayed, such as\ 0,\ t,\ n, etc., which are called escape characters.

The current support for VxWorks is as follows

The above is all the content of the article "what are the formatted output and escape characters of printf in vxworks?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report