链表内存图
struct letter
{
char ch;
struct letter *ptr_next;
}
*ptr_first,*ptr_this;
//ptr this contains the address of the first node and ptr this contains the address of last node added.
必须在链表中插入单词椅子,使得 C 进入第一个节点,h 进入第二个节点等等.. 附图是要填充的内存图。 我还添加了我尝试过的内容。如果我错了,请指导我。 提前致谢..
struct letter
{
char ch;
struct letter *ptr_next;
}
*ptr_first,*ptr_this;
//ptr this contains the address of the first node and ptr this contains the address of last node added.
A word chair has to be inserted in the linked list such that C goes into the first node,h in the second and so on..
The attached picture is the memory diagram to fill.
I also added what i tried.Please guide me if i am wrong.
Thanks in advance..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的问题的答案:不。
不,因为你在 ff15 留下了一个未解决的问号。
the answer to your question: no.
no, because you left one question mark unresolved at ff15.
问题是编译器将在
结构字母
中插入的填充字节。连续的结构字母
对象的地址永远不会像您的绘图中那样结束。The problem is the padding bytes your compiler will insert in your
struct letter
. The addresses of contiguousstruct letter
objects will never end up like in your drawing.