任何人都知道ino_t类型的占位符是什么?我正在尝试使用printf打印出来并尝试了%d,%i,%s和其他但不能正常工作.
printf( " file name = %s, i-node number=**%d**\n", direntp->d_name, direntp->d_ino);
warning: format ‘%i’ expects argument of type ‘int’, but argument 3 has type ‘__ino_t’ [-Wformat]
Run Code Online (Sandbox Code Playgroud)
假设我的其他代码是正确的.大多数示例仅显示如何打印名称,但不显示inode编号.我也搜过很多地方.
提前致谢
如果您知道类型是完整的,您可以将其转换为unsigned long long并使用%llu.
printf( " file name = %s, i-node number=%llu\n",
direntp->d_name, (unsigned long long)direntp->d_ino);
Run Code Online (Sandbox Code Playgroud)