3.3E7

本文介绍了一个使用C++实现的简单队列类。该队列类包含基本操作如入队、出队等,并定义了最大队列长度为10。文章详细展示了队列的初始化过程及如何判断队列是否为空,提供了队列元素的添加和获取方法。

const   int   maxqueue=10;

class  Queue{

public:

Queue();

bool  empty() const;

Error_code  serve();

Error_code  append (const Queue_entry&item);

Error_code  retrieve (Queue_entry&item)const;

protected;

int  front ,rear;

Queue_entry entry[maxqueue];

bool is_empty;

};

{

rear=-1;

front=0;

is_empty=true;

}

bool Queue::empty()const

{

return is_empty;

}

Error_code Queue::append(const  Queue_entry&item)

{

if{empty()}

return underflow;

if{rear==front}is_empty=true;

front=((front+1)==maxqueue)?0:(front+1)

return  success;

}

Error_code Queue::retrieve(Queue_entry&item)const;

{

if{empty()}return underflow;

item =entry[front];

return success;

}

gdb libvo_test_so.so /home/mdc/var/log/npu/coredump/core.\!mnt\!vo_test-26826-46889 GNU gdb (GDB) iAOS3.3 9.2-1.AOS3.3 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "aarch64-aos-linux". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from libvo_test_so.so... (No debugging symbols found in libvo_test_so.so) warning: core file may not match specified executable file. [New LWP 26826] [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1". Core was generated by `./vo_test --mode=func --scene=VoTestBase&#39;. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000e7fbe569cb04 in ?? () Missing separate debuginfos, use: dnf debuginfo-install compiler-rt-builtins-12.--Type <RET> for more, q to quit, c to continue without paging-- 0.1-1.a1.AOS3.3.aarch64 glibc-2.34-AOS3.3.aarch64 (gdb) bt #0 0x0000e7fbe569cb04 in ?? () #1 0x0000e7fbe69677b0 in ?? () from /usr/lib64/libc.so.6 #2 0x0000e7fbe6a9c000 in sys_sigabbrev () from /usr/lib64/libc.so.6 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) where #0 0x0000e7fbe569cb04 in ?? () #1 0x0000e7fbe69677b0 in ?? () from /usr/lib64/libc.so.6 #2 0x0000e7fbe6a9c000 in sys_sigabbrev () from /usr/lib64/libc.so.6 Backtrace stopped: previous frame identical to this frame (corrupt stack?)
07-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值