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.
Gforth文档说通过调用来访问参数next-arg,但这省略了程序名称,它将以类似 C 的语言打印。
next-arg
由于argv[0]似乎自动从 Forth 中的参数向量中删除,有没有我可以调用的特殊函数返回它?
argv[0]
sourcefilename给出程序的名称,并n arg获取发送到 gforth 的参数,包括 gforth 二进制名称。
sourcefilename
n arg
0 arg将始终返回argv[0],而 arg 列表的其余部分由next-arg. sourcefilename是您刚刚加载的文件的名称。
0 arg
我在链接类实现中重载了'<<'运算符,我在主函数中声明了.cpp文件,但它不起作用,并且发生此错误: 未定义对运算符<&列表的引用)
这是linkedlist.h文件中ostream函数的声明:
friend