Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
下面的代码创建文件,但不向其中写入数据。
p=outfile("outfile.txt" "w") fprintf(p "write to out file")
Cadence 对文件使用缓冲 IO,因此要查看输出,您需要像这样显式刷新端口:
drain(p)
当您关闭端口时,端口也会自动刷新,因此只有在您想查看中间输出时才需要这样做。